tags:

views:

60

answers:

3
+2  A: 

You can not specify negative value to LIMIT clause:

LIMIT -20,20 

It means you want to return 20 rows starting from -20 which is wrong.

Sarfraz
Limit by default is 0,20 its not negative..!!$limit = array(0,20)
Oyeme
@Oyeme: I know but you are specifying negative `-20, 20` in your query `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`. You will have to modify your function to not allow negative values for the `limit` clause.
Sarfraz
thanks you.. i found my error..i used codeigniter core,its codeigniter bug i used like this $this->db->limit(0, 30); AND it works..
Oyeme
@Oyeme: That is good news :)
Sarfraz
+1  A: 

The limit cannot be negative.

Daniel Egeberg
+3  A: 

The OFFSET value of the LIMIT clause has to be a nonnegative integer constant. Quoting the MySQL Documentation:

The LIMIT clause can be used to constrain the number of rows returned by the SELECT statement. LIMIT takes one or two numeric arguments, which must both be nonnegative integer constants (except when using prepared statements).

Daniel Vassallo