[Tool/Web/Other] [PHP] Query and RCON API (30/06/2012)
#6

Код:
Parse error: syntax error, unexpected T_AS, expecting ';' in /home/kevin/public_html/online.php on line 60
PHP код:
<?php
$query 
= new SampQuery("178.32.227.161"7777); 
if (
$query->connect()) { 
   echo 
"<table><tr><td><strong>ID</strong></td><td><strong>Name</strong></td><td><strong>Score</strong></td><td><strong>Ping</strong></td></tr>"
    
   
$players $query->getDetailedPlayers(); 
   foreach (
$players as $player) { //line 60.
      
echo "<table><tr><td>{$player['playerid']}</td><td>{$player['nickname']}</td><td>{$player['score']}</td><td>{$player['ping']}</td></tr>"
   } 
   echo 
"</table>"
} else { 
   echo 
"Error: Couldn't connect to server."

?>
Changed 'for' to foreach.
Reply


Messages In This Thread
[PHP] Query and RCON API (24/07/2014) - by StatusRed - 30.06.2012, 14:52
Re: [PHP] Query and RCON API (30/06/2012) - by next-studio|TheKiller - 30.06.2012, 14:56
Re: [PHP] Query and RCON API (30/06/2012) - by StatusRed - 30.06.2012, 15:00
Re: [PHP] Query and RCON API (30/06/2012) - by SomebodyAndMe - 10.07.2012, 10:03
Re: [PHP] Query and RCON API (30/06/2012) - by StatusRed - 10.07.2012, 16:20
Re: [PHP] Query and RCON API (30/06/2012) - by SomebodyAndMe - 10.07.2012, 16:53
Re: [PHP] Query and RCON API (30/06/2012) - by StatusRed - 10.07.2012, 17:01
Re: [PHP] Query and RCON API (30/06/2012) - by SomebodyAndMe - 10.07.2012, 17:08
Re: [PHP] Query and RCON API (30/06/2012) - by StatusRed - 10.07.2012, 17:11
Re: [PHP] Query and RCON API (30/06/2012) - by SomebodyAndMe - 10.07.2012, 17:14
Re: [PHP] Query and RCON API (30/06/2012) - by iRaiDeN - 12.06.2014, 11:54
Re: [PHP] Query and RCON API (30/06/2012) - by StatusRed - 27.06.2014, 11:50

Forum Jump:


Users browsing this thread: 1 Guest(s)