problem with php code...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
krsm1980
Forum Commoner
Posts: 25
Joined: Sat Jan 09, 2010 12:33 am
Location: IN
Contact:

problem with php code...

Post by krsm1980 »

I am really in a bad picture, one of my programmer left me in the middle, and offered me wired coded CMS, designed on PHP + MySQL

I have one object which is taking date; and storing this into database.

All i want to enter a simple string from this object and store this value into database.

I have changed the DATABASE STRUCTURE from date to VARCHAR.

But i am not able to track down from where it's taking the values to database, sothat i can initiatlize one variable to this object value, and move to database.

So please help....

bizManagment.php is the main page, where all fucntions are defined in an array.

$func_ary=array("updateBiz_info","show_price","biz_webplan_edit","edit_webplan");



This is the respossible funcation for add, edit

Code: Select all

function edit_biz_reg($msg="")

{

	global $SVP;

	global $SVP_Main;

	$R=DIN_ALL($_REQUEST);

	$t=new Template("templates");

	$t->set_file("MyFileHandle","edit_biz_info.htm");

	if($R[bizId]>0){

		gri("tlbbizinfo","where bizId='$R[bizId]'","",$req);

		$t->set_var($req);         					 

	}

	gri("tlbcity","Where cityId='$req[cityId]'","cityStateId",$stateId);

	get_new_option_list("tlbstate","stateId","stateName","$stateId[cityStateId]",$option_state_list,0," Where status='1' order by stateName asc",1,0,"Select State");

	

	get_new_option_list("tlbcity","cityId","cityName","$req[cityId]",$option_city_list,0," Where status='1'",1,0,"Select City");

	//$todayDate="2011";
	$todayDate=$req[bizRegDate];
	//$todayDate=date("d/m/Y",$req[bizRegDate]); // to display date in edit mode

	

	$t->set_var(array("msg"=>$msg,

					  "option_state_list"=>$option_state_list,					

					  "option_city_list"=>$option_city_list,					

                      "checked_$req[bizStatus]"=>"checked",                    

					  "selectedPay_$req[bizPayMode]"=>"checked",					

					  "selected_$req[bizContactTitle]"=>"selected",					

					  "SVP"=>$SVP,

					  "SVP_Main"=>$SVP_Main,

					  "bizRegDate"=>$todayDate,  				 

					));

	$t->parse("MyOutPut","MyFileHandle");

	parse_index_c($t->get("MyOutPut"));

}

function updateBiz_info($msg="")

{

	global $SVP;

	global $SVP_Main;

	$R=DIN_ALL($_REQUEST);

	if($R[bizContactName]=="")

			$R[bizContactTitle]="";

	func_edit_newBiz($R); 	

	echo "Update successfully";

}


I want "bizRegDate" to be entered just as a simple VARCHAR, but whenever i try to do so, it taking a junk value in it; all the time "943900201";

so please help.
User avatar
akuji36
Forum Contributor
Posts: 190
Joined: Tue Oct 14, 2008 9:53 am
Location: Hartford, Connecticut

Re: problem with php code...

Post by akuji36 »

I think bizRegDate field should be changed to int then it will contain all numbers

to be shown in a unix timestamp format. This format can be converted into readable "human time".

Follow this link:

http://www.epochconverter.com/
Post Reply