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. Quote 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? Quote 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. Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.