How to insert Time with AM/PM to MySQL database using PHP
I want to insert Time in MySQL database. In database I have two separate Fields for Date(date type) and Time(Time type). To insert a record I tried like below in my PHP. But Time only inserted(10:00:00). not AM/PM inserted. How to insert Time with AM/PM in PHP.
mysql_query("INSERT INTO Http(mobile, imei, time,date) VALUES ('1232456785', '123369584895544', TIME_FORMAT( '10:00:00', '%h:%i:%s %p' )开发者_JAVA百科,'2011/09/13')");
You can't do it. Here are formats for TIME type: http://dev.mysql.com/doc/refman/5.0/en/time.html
精彩评论