EchoFool Posted April 6, 2008 Share Posted April 6, 2008 Is it possible to order data in a primary way then a secondary way in the same query? For example some thing like: <?php $Get = mysql_query("SELECT UserID,Title,Infomation,Allowed FROM staff ORDER BY StaffType ASC ORDER BY UserID DESC") Or die(mysql_error()); ?> So you then would have the staff grouped by either admin/coder etc followed by each group sorted by UserID like: Admin: User 2 User 1 Coder: User 6 User 3 Link to comment https://forums.phpfreaks.com/topic/99894-order-by-twice/ Share on other sites More sharing options...
AndyB Posted April 6, 2008 Share Posted April 6, 2008 Yes ... as long as you have the syntax right (which you don't) - http://www.w3schools.com/php/php_mysql_order_by.asp Link to comment https://forums.phpfreaks.com/topic/99894-order-by-twice/#findComment-510856 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.