View Single Post
Join Date: Sep 2008
Posts: 6
Reputation: pocnib is an unknown quantity at this point 
Solved Threads: 0
pocnib pocnib is offline Offline
Newbie Poster

PHP Date always returns 0

 
0
  #1
Dec 4th, 2008
I am trying to insert a date into a mysql table field using
  1. <?php
  2. $date=date(Y-m-d);
  3. mysql_query("INSERT INTO table VALUES('$date')");
  4. ?>

but when I open up mysql and run SELECT * FROM table; it returns a date value of 0000-00-00 instead of the current date at time of insert. Am I misunderstanding something with the php date function?
Reply With Quote