searching for users with same ip

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
nite4000
Forum Contributor
Posts: 209
Joined: Sun Apr 12, 2009 11:31 am

searching for users with same ip

Post by nite4000 »

Hey,

I want to on a page have it display the list of users with more then one account by ip address.

I know this isnt hard but nothing i have tried works.

If anyone can help

Thanks
User avatar
andyhoneycutt
Forum Contributor
Posts: 468
Joined: Wed Aug 27, 2008 10:02 am
Location: Idaho Falls

Re: searching for users with same ip

Post by andyhoneycutt »

Could you be a little more specific? Are the users' IP Addresses stored somewhere? Are you just trying to find the IPs of all concurrent sessions? Not really sure what you're asking...
nite4000
Forum Contributor
Posts: 209
Joined: Sun Apr 12, 2009 11:31 am

Re: searching for users with same ip

Post by nite4000 »

the ip address is stored in a members table.
Kurby
Forum Commoner
Posts: 63
Joined: Tue Feb 23, 2010 10:51 am

Re: searching for users with same ip

Post by Kurby »

This is a sql query:

SELECT COUNT(*), ip_address FROM members
GROUP BY ip_address
HAVING COUNT(*) > 1

This will give you all the ip_addresses that have multiple members. Obviously the column and table names could be different.
Post Reply