johnslater Posted March 12, 2008 Share Posted March 12, 2008 I want to count rows with PHP from mysql, then with each total i want to order them. So like you would normally output with MySQL and order it in the query i want to do a row round for several row-count-queries and then order them highest to lowest. Thanks. Link to comment https://forums.phpfreaks.com/topic/95817-mysql-row-count-ordering/ Share on other sites More sharing options...
soycharliente Posted March 12, 2008 Share Posted March 12, 2008 $sql = "SELECT * FROM `table` WHERE COUNT(`id`) AS `num_ids` ORDER BY `num_ids` DESC"; Link to comment https://forums.phpfreaks.com/topic/95817-mysql-row-count-ordering/#findComment-490525 Share on other sites More sharing options...
johnslater Posted March 12, 2008 Author Share Posted March 12, 2008 I will test that now. Thanks. Link to comment https://forums.phpfreaks.com/topic/95817-mysql-row-count-ordering/#findComment-490561 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.