Mysql interprets 00:00:00 as 12:00am?
So mysql has a time(type) in which it has a 24 hour clock stored that can ouput time in am/pm format with the mysql function date_format(). The only problem is that when the user doesnt select the time, the value that stores in the mysql database is 00:00:00 which turns out to be 12:00am when i echo it with php. So how would i frame it so it can tell a difference between a null value and 00:00:00 which is 12:00am? (Btw, i try inserti开发者_如何学Pythonng null into the time column, turns out to be 00:00:00, which is 12:00am).
So how would i frame it so it can tell a difference between a null value and 00:00:00 which is 12:00am? (Btw, i try inserting null into the time column, turns out to be 00:00:00, which is 12:00am).
Make the column nullable. (Remove the NOT NULL constraint.)
Its far better to validate the user input field by keeping select time field as a mandatory one.
Thanks
精彩评论