title: How to fix syntax error, unexpected T_IF error in php?
body: <p>Parse error: syntax error, unexpected T_IF in view.php on line 27</p>
  
  <p>I really dont see any problem in my code, why this is happening, please help. Im a beginner in PHP</p>
  
  <p>Where my LINE 21 is >>  <strong>if(isset($_GET['page']) &amp;&amp; is_numeric($_GET['page']))</strong></p>
  
  <pre><code>if ($result = $mysqli-&gt;query("SELECT * FROM players ORDER BY id"))
  {
      if ($result-&gt;num_rows &gt; 0)
      {
          $total_result = $result-&gt;num_rows;
          $total_pages = ceil($total_result / $per_page)
  
          if(isset($_GET['page']) &amp;&amp; is_numeric($_GET['page']))
          {
              $show_page = $_GET['page'];
  
              if ($show_page &gt; 0 &amp;&amp; $show_page &lt;= $total_pages)
              {
                  $start = ($show_page - 1) * $per_page;
                  $end = $start + $per_page;
              }
              else
              {
                  $start = 0;
                  $end = $per_page;
              }               
  
          }
          else
          {
              $start = 0;
              $end = $per_page;
          }
  
  
          //display paginations
          echo "&lt;p&gt; View pages: ";
          for ($i=1; $i &lt; $total_pages; $i++)
          { 
              if (isset($_GET['page']) &amp;&amp; $_GET['page'] == $i)
              {
                  echo  $i . " ";
              }
              else
              {
                  echo "&lt;a href='view-pag.php?$i'&gt;" . $i . "&lt;/a&gt; | ";
              }
  
          }
          echo "&lt;/p&gt;";
  
      }
      else
      {
          echo "No result to display.";
      }
  
  }
  else
  {
      echo "Error: " . $mysqli-&gt;error;
  }
  </code></pre>