Hi,
I have converting date from d-m-Y format to Y-m-d format using date function but the date which is getting inserted is a junk value.
My code is as follows ::
The value which is inserted in FORM fields DOE & LDT is in d-M-Y format like 06-06-2010
Code ::
$DOE=$REQUEST['DOE'];
$DOE=date('Y-m-d', strtotime($DOE));
$LDT=$REQUEST['LDT'];
$LDT=date('Y-m-d',strtotime($LDT));
$postid=$_REQUEST['id'];
UPDATE $tablename SET DOE='".$DOE."',LDT='".$LDT."' WHERE id = '".$postid."'";
The update is happening but the date which is update for values 06-06-2010 is 01-12-2011 ??? Y????