It is possible to find if there are 2 ip's the same in a database but without have one to search for? i mean let's say i have 100 ip in my database.. how can i querry the database to see if there are 2 same ip's?
Something like this. SELECT ip, COUNT(*) AS countnum FROM tablename GROUP BY ip; Basically you can then loop thru the results and find ones with a 'countnum' field as higher than 1 (as I'm not sure throwing 'WHERE countnum > 1' would work).
I can see the numbers of distinct ip's <?php $query = "SELECT COUNT(DISTINCT ip_address) FROM ip"; $result = mysql_query($query) or die(mysql_error()); while($ro = mysql_fetch_array($result)){ $bo=$ro['COUNT(DISTINCT ip_address)']; echo "$bo"; } ?> PHP: and with a little more code i can see that uniq ip's $resulte = mysql_query("SELECT ip_address, COUNT(*) FROM ip GROUP BY ip_address") or die(mysql_error()); echo "<table border='1'>"; echo "<tr> <th>Number</th> <th>Ip</th> </tr>"; // keeps getting the next row until there are no more to get while($row = mysql_fetch_array( $resulte )) { // Print out the contents of each row into a table echo "<tr><td>"; echo $row['COUNT(*)']; echo "</td><td>"; echo $row['ip_address']; echo "</td></tr>"; } echo "</table>"; PHP: EDIT. Works. Thank you.