there is a table prefix_wall
----------id 1 2 3 4 5 6 7 9 ----------wall_user_id 10 11 10 9 9 16 16 10 ----------user_id 12 22 33 32 33 44 22 434 wall_user_id - id wall of the user user_id - id of the user who left the message
вторая таблица 'prefix_user' ----------user_id 1 2 5 ----------user_profile_name Иванов Петров Саутин How to make such a conclusion so that it would output like this:
He took the wall_user_id and counted how many identical entries in it and displayed the number
wall_user_id | кол-во записей которые повторяются 10 | 3 11 | 1 9 | 2 16 | 2 //ВЫВОД if(!isset($_GET['wall_user_id'])) { $result = mysql_query("SELECT wall_user_id, wall_user_id, COUNT( wall_user_id) AS wall_user_id FROM prefix_wall GROUP BY wall_user_id"); $myrow = mysql_fetch_array($result); do { echo "<b>".$myrow['wall_user_id']."-<br>" ; } while ($myrow = mysql_fetch_array($result)); } //ВЫВОД
COUNTcanceled chtoli inmysql? Have you tried to write something? - Alexey Shimanskycount(*) as cntand output the quantity in cnt just as you would print wall_user_id - BOPOH