Democreous Posted February 4, 2007 Share Posted February 4, 2007 I was wondering if it is possible to order a mysql query by two things. I'm trying to order it using the date and the time, which are two separate fields, so it orders by the date, then if there are multiple dates, by the time. right now it looks like this $sql = mysql_query("SELECT * FROM calendar_events WHERE event_date LIKE '____-$month-__' ORDER BY event_date && event_time ASC" ); One of the statements after ORDER doesn't work, and I have a feeling I cannot do this. Any suggestions? Link to comment https://forums.phpfreaks.com/topic/37022-solved-ordering/ Share on other sites More sharing options...
Tyche Posted February 4, 2007 Share Posted February 4, 2007 use a comma instead of && ORDER BY event_date, event_time Link to comment https://forums.phpfreaks.com/topic/37022-solved-ordering/#findComment-176735 Share on other sites More sharing options...
Democreous Posted February 4, 2007 Author Share Posted February 4, 2007 thanks a lot, exactly what I needed. Link to comment https://forums.phpfreaks.com/topic/37022-solved-ordering/#findComment-176737 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.