954,560 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Adding Time data to MySQL

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
2) what the field type, attributes, length/values, etc should be

Thanks!

super9876
Newbie Poster
8 posts since Jan 2010
Reputation Points: 10
Solved Threads: 0
 

I saw a sample on the page blow. Have a look and see if it helps.
http://www.tizag.com/mysqlTutorial/mysql-time.php

catherine sea
Junior Poster
126 posts since Jan 2008
Reputation Points: 25
Solved Threads: 20
 

Thanks Catherine. I'll play around with that and see if it works for me.

super9876
Newbie Poster
8 posts since Jan 2010
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: