Ok so i have a csv text file with the following columns in it:
Start Time End Time
JAN 24 17:50:52 20100 JAN 24 17:51:01 2011
I have imported the data in mysql table fine , now i want to convert the data to the correct datetime stamp(0000-00-00 00:00:00) so i did the following:
PHP Code:
$result=mysql_query("select * from telelogs"); while($row = mysql_fetch_array($result)){ $my_time= $row['Start Time']; $ne=strtotime($my_time); $new=date('Y-m-d H:i:s',$ne); $neww=mysql_query("update telelogs set 'Start Time' = '$new' where 'Start Time' = '$my_time'"); echo "<br />"; }
But it does not work , am i on the right track here or not?
Last edited by chrishirst; 03-08-2011 at 04:12 PM..
|