boblee Posted January 27, 2009 Share Posted January 27, 2009 Hello everyone, What I want to do is select all the rows in a database, where there are 3 fields (question, answer, number). I want to select the number values and and display them in numeric order. for example, say the database looks like this: Question Answer Number Q1 A1 1 Q5 A5 5 Q3 A3 3 Q2 A2 2 Q4 A4 4 and then out put would look like this: Q1 A1 1 Q2 A2 2 Q3 A3 3 Q4 A4 4 Q5 A5 5 I want to do this because I have a FAQ page setup but I want the admin to be able to change the order that the questions appear. Any help would be great. -Thanks Link to comment https://forums.phpfreaks.com/topic/142681-selecting-rows-and-ordering-them-based-on-numeric-value/ Share on other sites More sharing options...
bluesoul Posted January 27, 2009 Share Posted January 27, 2009 $query = "SELECT Question, Answer, Number FROM table ORDER BY Number"; Link to comment https://forums.phpfreaks.com/topic/142681-selecting-rows-and-ordering-them-based-on-numeric-value/#findComment-747868 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.