-1

ERROR : Parse error: syntax error, unexpected end of file in C:\xampp\htdocs\Paginas\RankPlayer.php on line 35

ERROR : Parse error: syntax error, unexpected end of file in C:\xampp\htdocs\Paginas\RankPlayer.php on line 35

ERROR : Parse error: syntax error, unexpected end of file in C:\xampp\htdocs\Paginas\RankPlayer.php on line 35

<?php
           include ("DBConfig.php");

            $result=pg_query($conn, "SELECT * FROM Players ORDER BY exp DESC LIMIT 0, 10;");
            if  (!$result) {
            echo "query did not execute";





           $rank = 1;
           echo "<h1>RANKING TOP 10</h1>";
           echo "<table width=\"591\" border=\"0\">";
           echo "<tr>";
           echo "<p><td width=\"50\">posição</td></p>";
           echo "<p><td width=\"100\">Nome</td></p>";
           echo "<p><td width=\"50\">Experiência</td></p>";
           echo "<p><td width=\"50\">Kills</td></p>";
          // echo "<p><td width=\"50\">deaths</td></p>";
          // echo "<p><td width=\"50\">Patente</td></p>";
           echo "</tr>";
           while($array = pg_fetch_object($query)) {
           echo "<tr>";
           echo sprintf("<td>%d</td>", $rank++);
           echo sprintf("<td>%s</td>", $array->name);
           echo sprintf("<td>%d</td>", $array->exp);
           //echo sprintf("<td>%d</td>", $array->kills_count_s);
          // echo sprintf("<td>%d</td>", $array->deaths_count_s);
           echo sprintf("<td><img src=\"Ranking\PAT\%s.gif\"/></td>", $array->rank);
           echo "</tr>";
} 
           echo "</table>";

?>
Funk Forty Niner
  • 74,450
  • 15
  • 68
  • 141

1 Answers1

0

You should end the if statement as well with }. Put } at the end.

Harshit
  • 5,147
  • 9
  • 46
  • 93
  • Warning: pg_query(): Query failed: ERRO: sintaxe LIMIT #,# não é suportada LINE 1: SELECT * FROM Players ORDER BY exp DESC LIMIT 0, 10; ^ HINT: Utilize cláusulas LIMIT e OFFSET separadas. in C:\xampp\htdocs\Paginas\RankPlayer.php on line 4 query did not execute RANKING TOP 10 Notice: Undefined variable: query in C:\xampp\htdocs\Paginas\RankPlayer.php on line 23 Warning: pg_fetch_object() expects parameter 1 to be resource, null given in C:\xampp\htdocs\Paginas\RankPlayer.php on line 23 – Guilherme Henrique Sep 22 '15 at 03:33