> i need help regarding a sql query in my php app. > > the query is : > $SQL = "SELECT DISTINCT(EMail) FROM mena_guests WHERE > Voted = 'yes' > LIMIT $startingID,$items_numbers_list"; > > i want to sort this query by the number of the repeated EMail counts. > can anyone help me with that please ? A) Is this a PHP question? If so, please post the PHP code you are having trouble with. B) While you could dump the results of your query into an array, and use sort() or the other array sorting methods to sort it any way you wanted to (thus making this a PHP question), it would certainly be more efficient to have MySQL return a properly sorted result set to begin with. C) It appears that by your use of DISTINCT(), you will not have repeating EMail values in your result set, thus you could not sort it by repeating emails. D) You will find many more relevant answers and many more willing participants if you were to post your question to a MySQL oriented list. JM -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php