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. Quote Link to comment 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"; Quote Link to comment Share on other sites More sharing options...
johnslater Posted March 12, 2008 Author Share Posted March 12, 2008 I will test that now. Thanks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.