If i run the following code in phpmyadmin it shows a column with the total occurrences for each friendly_name but when i run it in php and echo out the table i dont know how to pull the value of occurences and add it to my table?
SELECT *, COUNT(*) AS occurrences
FROM my_reports
GROUP BY friendly_name
HAVING count(*) > 1
ORDER BY occurrences DESC
This is the code im echoing out and i know its probably incredibly simple but i havent tried this before so i dont know where to start
while ($row = mysql_fetch_array($sel_rs))
{
$hud_id = $row['hud_id'];
$friendly_name = $row['friendly_name'];
echo '<tr><td>'.$hud_id.'</td>';
echo '<td>'. $friendly_name.'</td>';
echo '<td>'. what do i put here to show occurances for each.'</td></tr>';
}
echo "</tbody></table>";