Now I have a table, where I know there are duplicate e-mail.
I would like something that echoes out all the duplicates and a number next to it telling me how many duplicates I have.
and so on… showing me only the ones that have duplicates and the top one first.
What I have now is just showing me the top one, so I guess there only have to be a modification of the following:
$result = mysql_query("SELECT email, COUNT(email) AS countemail FROM temp_db GROUP BY email ORDER BY countemail DESC LIMIT 1");
$row = mysql_fetch_assoc($result);
echo "<p>The most duplicated email is " . $row['email'] . "</p>";
When you retrieve query results you usually do a loop, handling each result as you wish. So, by removing the limit 1 you tell sql to give you all the results. Then you need to process the results, using a while or foreach and echo out the info from each row.