PHPNewbie55 Posted December 17, 2007 Share Posted December 17, 2007 Is there any way to sort by more than one field..?? <?php mysql_query("SELECT * FROM table_name ORDER BY field 1 and field 2") ?> Link to comment https://forums.phpfreaks.com/topic/82067-solved-sort-by-more-than-one-field/ Share on other sites More sharing options...
p2grace Posted December 17, 2007 Share Posted December 17, 2007 Try this: mysql_query("SELECT * FROM table_name ORDER BY `field1`,`field2`"); Link to comment https://forums.phpfreaks.com/topic/82067-solved-sort-by-more-than-one-field/#findComment-417032 Share on other sites More sharing options...
papaface Posted December 17, 2007 Share Posted December 17, 2007 SELECT column_name(s) FROM table_name ORDER BY column_name1, column_name2 Link to comment https://forums.phpfreaks.com/topic/82067-solved-sort-by-more-than-one-field/#findComment-417033 Share on other sites More sharing options...
PHPNewbie55 Posted December 17, 2007 Author Share Posted December 17, 2007 Cool that works... Now I onlyhave one more question before I start my day and recode a bunch of stuff...... THANK YOU! Link to comment https://forums.phpfreaks.com/topic/82067-solved-sort-by-more-than-one-field/#findComment-417036 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.