mysql query
#1

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");
Reply
#2

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)