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 tidy it up. <? $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/42250-messy-wrong-output/ Share on other sites More sharing options...
grlayouts Posted March 11, 2007 Author Share Posted March 11, 2007 ne1? Link to comment https://forums.phpfreaks.com/topic/42250-messy-wrong-output/#findComment-204960 Share on other sites More sharing options...
kenrbnsn Posted March 11, 2007 Share Posted March 11, 2007 How do you want the output to look? Ken Link to comment https://forums.phpfreaks.com/topic/42250-messy-wrong-output/#findComment-204966 Share on other sites More sharing options...
paul2463 Posted March 11, 2007 Share Posted March 11, 2007 <? print_r($doubleips); ?> //print_r will always output an array in this fashion, you want it in another fashion find another method of output Link to comment https://forums.phpfreaks.com/topic/42250-messy-wrong-output/#findComment-204968 Share on other sites More sharing options...
grlayouts Posted March 11, 2007 Author Share Posted March 11, 2007 I want the output to look like User Admin (1(id)) has the same IP address as user Admin (2(id) Link to comment https://forums.phpfreaks.com/topic/42250-messy-wrong-output/#findComment-204981 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.