title: date() returns 0000-00-00
body: <p>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. </p>
  
  <pre><code>$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'; "));
  </code></pre>
  
  <p>What I'm doing wrong? Thanks!</p>