iPixel Posted September 19, 2007 Share Posted September 19, 2007 Ok here we go .. Ive got this DB table, and it looks like this: Fields ===== priority model desc vendor status complete pm timestamp date new now i need to sort this twice.. the first sort is by prioritywhich ranges from 1 to 10, 1 being most important 10 worst. And the second sort has to be by timestamp which has to be in order from latest entered record first then earliest and so on. naturally the first sort will be in the query $Qquery = "SELECT * FROM photoqueue ORDER BY priority ASC"; $Qsql = mysql_query($Qquery) or die('Queue Query Error : ' . mysql_error()); $Qresult = mysql_fetch_assoc($Qsql); So im not sure whats best to do now ... 1. Enter the results into and array and resort it there before dynamically echo'ing the results. 2. Some other way im not aware of ... my problem is #1... im not too sure how to go about doing this ... Thanks in advance for all the help. ~iPixel Quote Link to comment https://forums.phpfreaks.com/topic/69955-solved-double-sortorder/ Share on other sites More sharing options...
Barand Posted September 19, 2007 Share Posted September 19, 2007 $Qquery = "SELECT * FROM photoqueue ORDER BY priority ASC, timestamp DESC"; Quote Link to comment https://forums.phpfreaks.com/topic/69955-solved-double-sortorder/#findComment-351380 Share on other sites More sharing options...
iPixel Posted September 19, 2007 Author Share Posted September 19, 2007 Crappola lol ! why did i never see anyone do this before ahahah, hence why i didnt know it can do so ! Bah i feel pretty R-Tarded rite now ! Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/69955-solved-double-sortorder/#findComment-351385 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.