Hi. I'd like to add time (and no date, and not a timestamp) data to a field in MySQL through a PHP form. I've been having problems, as the date is also included. But I only want the time (I want to be able to sort the data by the time, and I think it was adding today's date along with the time, so if I enter the data on 5 different days, it won't sort correctly). PHP Insert Code: .strtotime($event_start_date). MySQL field: Type: INT Length/Values: 10 Default: None Collation: Attributes: Unsigned Everything else empty Can anyone help with: 1) what should the php insert code be like. 2) what the field type, attributes, length/values, etc should Thanks!
Hi Webber98. You can use "TIME" type for the time field and query like "INSERT INTO some_table SET time_field=CURTIME()".
use: strototime(date('d-m-Y')); that is the correct format. Your $event_start_date should be in the same format "d-m-Y"