mysql query error - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: mysql query error (
/showthread.php?tid=582098)
mysql query error -
DetoNater - 17.07.2015
Actually this is the bug...
this is my mysql query
Код:
format(str,sizeof(str),"SELECT `Id` FROM `clans` ORDER BY `Clanscore` DESC LIMIT %d,1",listitem);
the 0,1 should return the value in 0'th row right? but it's returning the id of 5'th row!ut
Pics:
But the error is
Re: mysql query error -
Vince - 17.07.2015
I fail to see the problem. You're ordering by "ClanScore", but since all values are 0 MySQL is free to order it in whatever way it wants, which is apparently descending by id. The limit clause is the very last thing that gets applied and what "limit 0,1" actually means is: start with the 0th result
in the result set and get the next 1 rows.
Re: mysql query error -
DetoNater - 18.07.2015
thanks alot vince, its working!