title: SQL LIMIT return 'zero' - 0 - rows(IN PHP)
body: <p>I have an error in this query, when the query returns zero rows.
  <b><br>
  Error Number: 1064</p>
  
  <p>You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-20,20' at line 3</p>
  
  <p>SELECT pl.name,pl.email FROM players pl JOIN players_bonus pl_b on pl.id = pl_b.id_player WHERE pl_b.id_bonus = 3 LIMIT -20,20
  </b>
  <br>
  My method is:
  <pre><code>
      public function getPViews_num_rows($limit = array(0,20),$page_num = 1,$id) {
          $limit = "LIMIT {$limit[0]},{$limit[1]}";</p>
  
  <pre><code>    $sql = "SELECT pl.name,pl.email FROM players pl 
              JOIN players_bonus pl_b on pl.id = pl_b.id_player 
                  WHERE pl_b.id_bonus = ? {$limit}";
  
      $where =  array($id);
      $query = $this-&gt;db-&gt;query ( $sql,$where );
      return $query-&gt;num_rows ();
  }
  </code></pre>
  
  <p></pre></code>
  I don't wanna do another query to count rows,before I do this query.
  Thanks for the answers.</p>