If you want to keep someone from registering multiple accounts, you should consider using email verification. Make them give their email address when they register and have your script send them an email with a "confirm registration" link in it. That way the number of possible times someone can register is limited to how many email addresses they own. Its not 100% effective, but you won't end up blocking legit users. By only allowing 1 user per IP, you're taking that risk. For example, my roomate and I share an IP address. If we both wanted to register on your site then one of us would be blocked.
As for your question though, lets say you have this data in your ibf_members table:
+------+----------------+
| name | ip_address
+------+----------------+
| mike | 11.11.11.11
| jenn | 22.22.22.22
| john | 33.33.33.33
| jake | 22.22.22.22
+------+----------------+
There are two names associated with 22.22.22.22...you are trying to print
out the name, but there can be N names associated with an IP right? I mean,
you're not worried about "jenn" registering twice at 22.22.22.22 are you? I'm assuming "name" is really the "username", which is usually unique...ie, you
don't let "jenn" sign up as "jenn" twice, regarless of her ip address.
Anyhow, this is how I would print it out:
total, ip_address, (names)
2, 22.22.22.22, (jenn, jake)
If you want to use that format, here is the query:
SELECT COUNT(ip_address) as total, ip_address, GROUP_CONCAT(name) as names
FROM ibf_members
GROUP BY ip_address
HAVING total > 1
ORDER BY total;
Run that in phpmyadmin and see if it gives you the output you want. If it does,
then put it in php like this:
$result = mysql_query("
SELECT COUNT(ip_address) as total, ip_address, GROUP_CONCAT(name) as names
FROM ibf_members
GROUP BY ip_address
HAVING total > 1
ORDER BY total;
");
while($row = mysql_fetch_assoc($result)) {
echo "Total:".$row['total']." IP Address:".$row['ip_address']." Names:".$row['names'];
}