SA-MP Forums Archive
mysql query - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: mysql query (/showthread.php?tid=259952)



mysql query - Sascha - 06.06.2011

hey guys... I'm just having a little error in my mysql query, however I can't find it somehow..

Код:
Error (0): Failed to exeute query. 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.
pawn Код:
new price = strval(inputtext), Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
new query[300];
format(query, 100, "SELECT * FROM `houses`");
mysql_query(query);
mysql_store_result();
new n = mysql_num_rows();
mysql_free_result();
format(query, 100, "INSERT INTO `houses` (`id`, `price`, `x`, `y`, `z`) VALUES (%d, %d, %f, %f, %f)", n, price, x, y, z); // this line I guess
mysql_query(query);
SendClientMessage(playerid, CYAN, "*The house was added and will appear on the next restart");



Re: mysql query - Mean - 06.06.2011

pawn Код:
new query[300];
Код:
format(query, 100, ...
You put query size to 300, and in format, you put 100. Could be that because I can't find an error in the query itself.