hi everyone,
I am trying format the date and time entered by the user to the mysql format which is: yyyy-mm-dd hh:mm:ss
for example the user enters 25-8-2007 16:20:00
I want to convert it to 2007-08-25 16:20:00 and insert to the database.
the following is what I have tried, but does not work
$sql = mysql_query("INSERT INTO time_slot VALUES ('','{$row['hospital_id']}','DATE_FORMAT('{$_POST['appdate']}', '%Y- %m-%d- %T' )' ")
or die (mysql_error());
any help will be greatly appreciated.
thanks