I read the csv file, got the date from there, checked - everything is fine. as I write to the database, the date is only for the first line 1970-01-01 03:00:00 And only the first line, it normally writes the rest (I still convert the date to the desired format)
Do so
foreach ($fil as $val) { $trd = date('Ymd H:i:s', strtotime($val[1])); mysql_query("INSERT INTO mytable(id, date) VALUES ('$val[0]', '$trd')") Or die(mysql_error()); }
print_r($trd)? - blits$i=0; foreach ($fil as $val) { if (! $++) echo $val."br";$i=0; foreach ($fil as $val) { if (! $++) echo $val."br";- splash58