title: Using LIMIT WHERE at once in SELECT SQL
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2973202/mysql-fetch-array-expects-parameter-1-to-be-resource-boolean-given-in-select">mysql_fetch_array() expects parameter 1 to be resource, boolean given in select</a>  </p>
  </blockquote>
  
  
  
  <p>I've got problem with SELECT SQL since ive included LIMIT, so my code looks like this:</p>
  
  <pre><code>$id = $_GET['id'];
  
  $sql = "UPDATE rl_threads SET views = views + 1 WHERE id = '$id'";
  
  $sql = mysql_query($sql);
  
  //Pager
  
  $ile = 10;
  
  if(isset($_GET['page']))
  {
    $strona = $_GET['page'];
  }
  else
  {
    $strona = 1;
  }
  
  $strona = $strona - 1;
  
  $offset = $strona * $ile;
  
  //Koniec Pagera
  
  $sql = "SELECT * FROM rl_posts LIMIT $od, 10 WHERE thread_id = '$id'";
  
  $sql = mysql_query($sql);
  </code></pre>
  
  <p>until i havent add limit it worked properly but after the script says:</p>
  
  <pre><code>Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/radiolev/public_html/forum.php on line 194
  Partnerzy
  </code></pre>
  
  <p>Can someone help me fixing this issue?</p>