title: Paging in php displaying data over multiple pages
body: <p>Hi I am trying to display my users data over pages</p>
  
  <p>Here is my code:</p>
  
  <pre><code>//Run a query to select all the data from the users table
  $perpage = 2;
  $result = mysql_query("SELECT * FROM users LIMIT $perpage");
  </code></pre>
  
  <p>It does display this the only two per page but I was wondering how you get page numbers at the bottom that link to your data </p>
  
  <p>here is my updated code</p>
  
  <pre><code> $result = mysql_query("SELECT * FROM users");  // Let's get the query    
   $nrResults=mysql_num_rows($result); // Count the results    
  if (($nrResults%$limit)&lt;&gt;0) {       
   $pmax=floor($nrResults/$limit)+1;  // Divide to total result by the number of query 
  // to display per page($limit) and create a Max page    
   } else {     
  $pmax=floor($nrResults/$limit); 
  }     
  $result = mysql_query("SELECT * FROM users LIMIT 2 ".(($_GET["page"]-1)*$limit).", $limit");  
  // generate query considering limit    
  while($line = mysql_fetch_array( $result )) 
  {   
  ?&gt; 
  </code></pre>
  
  <p>error</p>
  
  <p>Parse error: syntax error, unexpected $end in E:\xampp\htdocs\Admin.php on line 98</p>