not inserteing date in mysql
Posted: Sat May 16, 2009 3:31 am
Hi,
I try to insert data in mysql from php.
I insert all data except field Date_Inserted where i store current date.
And It is inserting '0000-00-00'.
My code is as below:
please help me
Thanks in advance.
I try to insert data in mysql from php.
I insert all data except field Date_Inserted where i store current date.
And It is inserting '0000-00-00'.
My code is as below:
Code: Select all
$db->startTransaction();
try{
$today1 =date("Y-m-d");
$arValues = array();
$arValues['Pro'] = $pid;
$arValues['Cat'] = $proidhist['Cat];
$arValues['Sub']=$proidhist['Sub'];
$arValues['StartDate']=$proidhist['StartDate'];
$arValues['EndDate']=$proidhist['EndDate'];
$arvalues['Date_Inserted']=$today1;
$newId=$db->insertdelay("history",$arValues);
$Result = "Product Information updated successfully.<br>\n";
$db->commit();
}
catch(Exception $e)
{
$db->abort();
print "an error Ocurred.<br>\n".$e->getMessage();
$Result = "Product Information updated couldn't take place.";
}
Thanks in advance.