PHPilliterate Posted May 30, 2008 Share Posted May 30, 2008 I have an issue with a schedule. In one line of my table for "time", but being new to phpmysql, I made the mistake of having my data as "9:00AM" or "6:30PM".The problem is that my sort for "time" shows as 6:00PM is earlier than 9:00AM. Here is script for the sorting: SELECT * FROM ALFL WHERE (visitorTeam LIKE '%ParamvisitorTeam%' OR '-1' = 'ParamvisitorTeam') OR (homeTeam LIKE '%ParamhomeTeam%' OR '-1' = 'ParamhomeTeam') ORDER BY MONTH ASC, day, time, diamond Is there a "php for idiots" type of solution for this? Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted May 30, 2008 Share Posted May 30, 2008 Your best solution would be to change to a standard sql DATETIME (I see that you have some month/day columns) data type. This will result in the fastest operating application, especially if you expect the amount of data in the database to grow over time. Storing the date and time in a single DATETIME data field will simplify all your code and queries, result in the fastest performance, and result in the minimum storage requirements. Quote Link to comment Share on other sites More sharing options...
PHPilliterate Posted June 7, 2008 Author Share Posted June 7, 2008 Thanks for the help I will give it a try. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.