PDA

View Full Version : Get multiple listing of ipaddress is user table


kobescoresagain
06-09-2006, 07:38 PM
I am trying to get every ip address from user that is listed more than once. How can I do this? I know I need to do a count(ipaddress) but can't get the right output. Thanks

calorie
06-21-2006, 07:35 PM
Try...

$db->query_read("
SELECT COUNT(ipaddress) AS ipcount,
userid, username, ipaddress
FROM " . TABLE_PREFIX . "user
GROUP BY ipaddress
HAVING COUNT(ipaddress) > 1
");