grlayouts Posted March 11, 2007 Share Posted March 11, 2007 Ok, i have my own online PHP game. I have a multi account check that checks the ip of the player against other players But it outputs really random. I was wondering if anyone could make it output like... Admin (Userid) has the same ip address as Admin2 (userid) <? $title = "Multi Log"; include("header.php"); $get_mm = mysql_query("SELECT ip FROM players where jail='0' GROUP BY ip HAVING COUNT(ip) >1"); while($row=mysql_fetch_array($get_mm)){ $ip=$row[ip]; $get_mn = mysql_query("SELECT * FROM players WHERE ip='$ip'"); $row2=mysql_fetch_array($get_mn); if(!empty($row2)) $doubleips[] = $row2[user]; if(!empty($row2)) $doubleips2[] = $row2[id]; } ?> <?php if ($stat[user] != Admin) { print "sorry you cannot use this function."; include("footer.php"); exit; } ?> <? print_r($doubleips); ?> <br><br> <? print_r($doubleips2); ?> <br><br> <? print "<form method=post action=multi.php?view=ban&step=banned> ID: <input type=text name=id><br> Reason: <input type=text name=br><br> <input type=submit value=Ban></form>"; if ($step == banned) { mysql_query("update players set jail=21 where id=$id"); mysql_query("update players set level='0.0' where id=$id"); mysql_query("update players set zone1='BANNED' where id=$id"); mysql_query("update players set jailreason='$br' where id=$id"); print "Account banned"; include("footer.php"); exit; } ?> <? include("footer.php"); ?> its output looks like. Array ( [0] => LiLPLaT [1] => rustystar1105 [2] => Sparda [3] => eagles5 [4] => bradleynutty [5] => Zoner [6] => Admin [7] => flossyfarjo [8] => paws ) Array ( [0] => 257 [1] => 270 [2] => 178 [3] => 347 [4] => 125 [5] => 74 [6] => 1 [7] => 171 [8] => 343 ) Link to comment https://forums.phpfreaks.com/topic/42271-array-problems/ Share on other sites More sharing options...
Barand Posted March 11, 2007 Share Posted March 11, 2007 try <?php include 'db.php'; $sql = "SELECT a.id, a.username, a.ip, b.id, b.username FROM users a INNER JOIN users b ON a.ip = b.ip WHERE a.id < b.id "; $res = mysql_query($sql) or die (mysql_error().'<p>$sql</p>'); while (list ($aid, $auser, $ip, $bid, $buser) = mysql_fetch_row($res) ) { echo "$auser ($aid) has same IP address ($ip) as $buser ($bid)<br>"; } ?> Link to comment https://forums.phpfreaks.com/topic/42271-array-problems/#findComment-205067 Share on other sites More sharing options...
grlayouts Posted March 12, 2007 Author Share Posted March 12, 2007 Unknown column 'a.username' in 'field list' $sql Link to comment https://forums.phpfreaks.com/topic/42271-array-problems/#findComment-205289 Share on other sites More sharing options...
grlayouts Posted March 12, 2007 Author Share Posted March 12, 2007 Unknown column 'a.username' in 'field list' $sql ignore me it works. thanks Link to comment https://forums.phpfreaks.com/topic/42271-array-problems/#findComment-205296 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.