SQL LIMIT return 'zero' - 0 - rows(IN PHP) -


I have an error in this query, when the query returns zero rows
Error number: 1064

There is an error in your SQL syntax;

Select pl.name, pl.email players from pl players_bonus pl to pl pl at pl pl Check the related manual for your MySQL server version for the correct syntax to use on pl. Id = pl_b.id_player WHERE pl_b.id_bonus = 3 LIMIT -20,20
My way is:

  public function getPViews_num_rows ($ limit = array (0,20), $ page_num = 1, $ id) {$ limit = "LIMIT {$ border [0]}, {$ border [1]}";  
  $ sql = "Select pl.name, pl.email players at pl.id = pl_b.id_player Add players_bonus pl_b at WHERE pl_b.id_bonus =? {$ Limit}"; $ Where = array ($ id); $ Query = $ this- & gt; Db- & gt; Query ($ sql, $ where); Refund $ query-> Num_rows (); }  

I do not want to do another query to calculate the rows before querying this Thanks for the reply.

You can not specify negative < LIMIT -20,20

This means that you want to return back to 20 rows starting with -20 False .


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -