So i have database with a table called users.. and in that table there is a column named IP and i want to find users with the same IP and ban them.. So how can a search the
You can start by:
SELECT count(id) FROM tablename
GROUP BY IP
Then you just join those results back onto the table to get information about the duplicates
So modify the first statement with: SELECT count(id) as number, IP FROM tablename
Then
SELECT a.id, a.name FROM tablename a
JOIN (
SELECT count(id) as number, IP FROM tablename
) b ON a.IP = b.IP
WHERE number > 1
This should give you all the duplicate IP addresses in the Database. You may have to figure out a way to decide on which account to keep and which to remove, but this should give you a start.