I am trying to insert date into mysql but everytime it fails and comes out as 0000-00-00 in phpmyadmin
My date format is like 2012-08-06 (yyyy-mm-dd) and the date field type in database is date.
$date = "2012-08-06";
mysql_query("INSERT INTO data_table (title, date_of_event)
VALUES('". $_POST['post_title'] ."',
'". $date ."')") or die(mysql_error());
tried changing - to / or removing them, it doesn't work.
time()) instead of date. and use thedate()function to convert it to any format when displaying.