<?php $count = mysql_query("select count(*) count from user where ip='$ip'"); $count = mysql_fetch_assoc($count); if ( $count['count'] >= 2 ) { $q = mysql_query("select * from user where ip='$ip'"); while ( $data = mysql_fetch_assoc($q) ) { echo 'user: '.$data['nick'].', ip: '.$data['ip'].'<br />'; } } ?>
$res = mysql_query("SELECT `ip`, `count` FROM (SELECT `ip`, COUNT(`ip`) AS `count` FROM `users` GROUP BY `ip`) AS `t` WHERE `t`.`count` > 1"); while($row = mysql_fetch_array($res)) echo "ip".$row[0]." count:".$row[1]."</br>";