I have my query, but I want to show all of name's that are by each of the grouped ip's, currently is just shows 1. $query = "SELECT name, ip1, COUNT(ip1) FROM data GROUP BY ip1 ASC"; $result = mysql_query($query); while($row = mysql_fetch_assoc($result)) { echo "<td>{$row['ip1']} </td>" . "<td>{$row['COUNT(ip1)']}</td>"; echo "<td>{$row['name']}</td>"; } Code (markup):
Your would need to remove group by as it will limit your results to a unique ip1 . Try order by instead of group by. $query = "SELECT name, ip1, COUNT(ip1) FROM data ORDER BY ip1 ASC";