MySQL Forums
Forum List  »  General

Adding Time data to MySQL
Posted by: hemantha atthanayake
Date: January 02, 2012 01:20AM

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!

EXPLORE YOUR MIND

Options: ReplyQuote


Subject
Written By
Posted
Adding Time data to MySQL
January 02, 2012 01:20AM
January 02, 2012 04:57AM
January 03, 2012 10:38PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.