Wayniac Posted March 12, 2010 Share Posted March 12, 2010 Greetings everyone, I currently have my database date field "priority2" set to ORDER ASC. I also have another database field called "priority". The purpose of priority is to organize the entries into groups of importance (Ex: Current(100), Pending(200), Completed(300)). Both of these work very well. The problem is that I need to integrate them so that it all of the entries under "Current Priority" will be arranged in ASC format and so fourth. Here is my code for Priority: $query = "SELECT * FROM intheloop ORDER BY priority ASC $limit"; Here is my code for Priority 2: $query = "SELECT * FROM intheloop ORDER BY priority2 ASC $limit"; Basically I can switch the name and it will change to either one, how can I make it so that there both being used together... I await your reply, thank you so much for anything that you can offer to help push me in the right direction. Link to comment https://forums.phpfreaks.com/topic/195042-order-by-date-help/ Share on other sites More sharing options...
schilly Posted March 12, 2010 Share Posted March 12, 2010 $query = "SELECT * FROM intheloop ORDER BY priority ASC, priority2 ASC $limit"; Link to comment https://forums.phpfreaks.com/topic/195042-order-by-date-help/#findComment-1025301 Share on other sites More sharing options...
Wayniac Posted March 12, 2010 Author Share Posted March 12, 2010 Thank you so much, that worked way too easy. I was created IF statements and mocking up ways to make this work... Once again, thank you much. I checked out your website, I love the name and meaning behind it, too cool. Link to comment https://forums.phpfreaks.com/topic/195042-order-by-date-help/#findComment-1025308 Share on other sites More sharing options...
schilly Posted March 12, 2010 Share Posted March 12, 2010 np and thanks for checking the website =) Link to comment https://forums.phpfreaks.com/topic/195042-order-by-date-help/#findComment-1025317 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.