zampu Posted June 10, 2007 Share Posted June 10, 2007 Hello i need an mysql query to rank the results, like SELECT field FROM table and to order them greatest to least by the value of a different field. Any help is greatly appreciated. Link to comment https://forums.phpfreaks.com/topic/54915-mysql-results-ordering-them/ Share on other sites More sharing options...
soycharliente Posted June 10, 2007 Share Posted June 10, 2007 You're looking for ORDER BY. You can also sort ascending or descending. <?php $query1 = "SELECT field FROM table ORDER BY another_field ASC"; $query2 = "SELECT field FROM table ORDER BY another_field DESC"; ?> Link to comment https://forums.phpfreaks.com/topic/54915-mysql-results-ordering-them/#findComment-271612 Share on other sites More sharing options...
zampu Posted June 10, 2007 Author Share Posted June 10, 2007 Thanks! Link to comment https://forums.phpfreaks.com/topic/54915-mysql-results-ordering-them/#findComment-271621 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.