开发者

How to insert Time with AM/PM to MySQL database using PHP

开发者 https://www.devze.com 2023-04-04 23:15 出处:网络
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:0

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

0

精彩评论

暂无评论...
验证码 换一张
取 消