06.06.2011, 18:34
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");