date('H-m-s') gives something like this when I echo variable > 08-07-16
I have table in mysql and the field type is set to TIME.
And when I transfer this data there, in mysql table I see this > 00:00:08
I repeat it several times but I see only this > 00:00:08
What’s the problem with mysql ???
MySQL’s TIME type expects the time in the format
HH:MM:SS. Generate your date in PHP as:Or as eykanal points out, use the
DATETIMEtype instead.