datetime update in oracle and PHP

admin

Administrator
Staff member
Hi,
My database server is Oracle. I have some fields with datetime datatype. I could retrieve or update those fields as long as I need only date. But I need to update current datewithtime. Whatever format I use the update fails.

ex:$todaydt = date('m-d-y H:i:s');
list ($month, $day, $year) = split ('[/.-]', $todaydt);
$todaydt= date ("d M Y H:i:s", mktime (9,10,11,$month,$day, $year));

$sql = "Insert into xx_tbl(ref_id, entrydt)
values ('$ref_num','$todaydt');

The error message I get is,
OCIStmtExecute: ORA-01722: invalid number in ....line#....

For date only update in the same field I used
$todaydt= date ("d M Y", mktime (9,10,11,$month,$day, $year));
It inserted fine.
But not when I add time format. I used different ways,
$todaydt= date ("Y m d H:i:s", mktime (9,10,11,$month,$day, $year));

Could someone direct me where I am doing wrong?

Thanks
-Satya
 
Back
Top