hi: when inserting the date into the mysql: mysql_select_db('date'); $query = "insert into date values ('".DATE('j F Y H:i')."')"; $result = mysql_query($query); the date stored in mysql are always like "0000-00-00" rather than the normal format(e.g '12 June 2006 03:10') why?
If you have set the column to "date" it will store it in that format. Remember Y2K, it was because people weren't doing that. You'll see some systems drop the - between the values, the important thing is that it's in that format. Better for sorting, retrieving, everything. And your "June" is someone else's "juin" or å…æœˆ, liù yuè Once you have the date back from the database you can convert it to your "nice" format very easily.
Indeed, it's BECAUSE you have the column set to "date" It's bad to have it any other way. change your query to $query = "insert into date values ('".DATE('Y-m-d')."')"; $result = mysql_query($query); Code (markup): and it will save nicely. When you retrieve the date you just need to rework it to make it "nice" The only other way is to change the column to a varchar but that is NOT recommended.
if the date field si date type then try to use now() mysql function. insert into date values (now()); Code (markup): Regards