I’m trying to write a code that register the visit data of the user in a mysql table. This code worked well for a week or so (printing 2012-07-12 i.e) but then it started to produce 0000-00-00 in the date column.
$date_now = date("m.d.y"); // gets date
if (empty($username)) {} else (mysql_query ("INSERT INTO new_visit_data (user_id, date, exercise, lesson, username ) VALUES ('$user_id','$date_now', '' , 'yes', '$username' ) ON DUPLICATE KEY UPDATE lesson='yes'; "));
What I’m doing wrong? Thanks!
Provided that date is indeed ‘date’ type of column, It should be