Monk3h Posted January 31, 2009 Share Posted January 31, 2009 I am trying to create an multi checking script for my game. What i need to do is check the field IP in my players table and if the sql brings back multiple players with the same IP (2 or more) i would like to be alerted. How would do i do the SQL part to this? Link to comment https://forums.phpfreaks.com/topic/143297-multiple-same-result-sql/ Share on other sites More sharing options...
Snart Posted January 31, 2009 Share Posted January 31, 2009 $result = mysql_query("SELECT `username` FROM `users` where `ip` = '".$whatever."';") if(mysql_num_rows($result) > 1) { echo 'Someone has been naughty.'; } Link to comment https://forums.phpfreaks.com/topic/143297-multiple-same-result-sql/#findComment-751533 Share on other sites More sharing options...
Monk3h Posted January 31, 2009 Author Share Posted January 31, 2009 <?php $IPsel = mysql_query("select * from players WHERE 'IP' = 'IP'"); while ($multi = mysql_fetch_array($IPsel)) { Print "$multi[user] ($multi[id])<br><br>"; } ?> something like that, but I want it to check for players with the same IP. that just lists all the players where there IP = there IP which is all of them ofc.. =/ Link to comment https://forums.phpfreaks.com/topic/143297-multiple-same-result-sql/#findComment-751535 Share on other sites More sharing options...
Monk3h Posted February 1, 2009 Author Share Posted February 1, 2009 bump Link to comment https://forums.phpfreaks.com/topic/143297-multiple-same-result-sql/#findComment-751661 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.