Jump to content

mysql finding duplicates


ggkfc

Recommended Posts

ive got ppl's ips saved in the addr field (table = users) and i want to find those with same ips and print them in a table, is there something im doing wrong?

 

$rs = query("select addr, count(addr) as num from users group by addr having (count(addr) > 1)");

    echo "<table><tr><td>addr</td><td>count</td></tr>";

    while(list($addr, $count) = mysql_fetch_array($query))

    {

    echo "<tr><td>$addr</td><td>$count</td></tr>";

    }

    echo "</table>" 

Link to comment
https://forums.phpfreaks.com/topic/82634-mysql-finding-duplicates/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.