python72 Posted January 20, 2011 Share Posted January 20, 2011 I am trying to use the following query with sorting: $query = mysql_query("SELECT * FROM Table WHERE Date LIKE '$PeriodSelected' ORDER BY Date DESC"); $PeriodSelected is basically supposed to get me all results from month selected and it works fine. Now I am trying to add sorting to this query and although I get no errors it does not matter if I use ASC or DESC my results are sorted in the same way. Not sure what I am doing wrong. Link to comment https://forums.phpfreaks.com/topic/225035-can-order-condition-be-added-to-query/ Share on other sites More sharing options...
BlueSkyIS Posted January 20, 2011 Share Posted January 20, 2011 is the table actually called Table with a field called Date? Link to comment https://forums.phpfreaks.com/topic/225035-can-order-condition-be-added-to-query/#findComment-1162287 Share on other sites More sharing options...
python72 Posted January 20, 2011 Author Share Posted January 20, 2011 No but I changed the naming for posting. Anyways it works, it was my other code that caused the issue. Thanks anyways. Link to comment https://forums.phpfreaks.com/topic/225035-can-order-condition-be-added-to-query/#findComment-1162297 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.