There is such a script output and counting the amount of data, what am I doing wrong?

<table border="1"> <?php $res = mysql_query("SELECT t1.`count`, COUNT(t1.`count`) FROM (SELECT `name`, COUNT(*) as `count`FROM `clinet` GROUP BY `name`) AS t1 GROUP BY t1.`count`"); while($row = mysql_fetch_assoc($res)) { echo '<tr>'; echo '<td>'.$row['t1'].'</td>'; echo' <td>'.$row['count'].'</td>'; } ?> </table> 
  • Show the database structure. - Nick Volynkin
  • And what is issued? what error messages? - sercxjo
  • so what's the mistake? maybe tr forgot to close? - Jean-Claude
  • I think the subquery is identical to the first select ... - Jean-Claude
  • That's what you did. 1 counted the number of all identical names. 2 Counted all the number of the number of identical names. For example, you have 15 names "Sergey" 10 - "Anya" and 15 "Vadim". So the subquery returns 15, 10, 15. And then you count the number of identical names. That is, you will end up with 2 and 1 because 2-15 and 1-10. You tell me what result you need. - Daniel Abyan September

0