title: Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean given
body: <p>i'm new in php coding, and a have a small problem.
  I wanna make more pages to be posted if there are more than 20 rows in a table.
  What is the problem exactly?</p>
  
  <pre><code>&lt;?php
  $sql = "SELECT COUNT ID FROM out_fact"; 
  $query = mysql_query($sql); 
  $result = mysql_fetch_row($query); 
  $total_records = $result[0]; 
  $total_pages = ceil($total_records / 20); 
  
  for ($i=1; $i&lt;=$total_pages; $i++) { 
              echo "&lt;a href='view.php?page=".$i."'&gt;".$i."&lt;/a&gt; "; 
  }; 
  ?&gt;
  </code></pre>
  
  <p>If you need all the code, let me know. Thanks a lot!</p>