SA-MP Forums Archive
Error with this MySQL_Query Line? - 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: Error with this MySQL_Query Line? (/showthread.php?tid=502567)



Error with this MySQL_Query Line? - Dokins - 24.03.2014

pawn Код:
format(string, sizeof(string), "SELECT * FROM `arecords` WHERE `PSQLID` = %d ORDER BY `id` DESC LIMIT 10", PlayerSQLID[giveplayerid]);
    mysql_query(string);
It said:

Quote:

[20:41:16] mysql error 1064: 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 '' at line 1

it's probably a stupid mistake, but I'm not sure, I've never used 'Order BY etc.


Re: Error with this MySQL_Query Line? - Jefff - 24.03.2014

Try this

pawn Код:
"SELECT * FROM `arecords` ORDER BY `id` WHERE `PSQLID` = %d DESC LIMIT 10"



Re: Error with this MySQL_Query Line? - Dokins - 24.03.2014

Thank you! REP ++; < See what I did there


Re: Error with this MySQL_Query Line? - Vince - 24.03.2014

Query is correct as far as I can see. Possibly an inadequate string length.