SQL error, I can't find anything wrong in here. - 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: SQL error, I can't find anything wrong in here. (
/showthread.php?tid=663267)
SQL error, I can't find anything wrong in here. -
ShadowMortar - 26.01.2019
Code:
if(strcmp(option, "exit", true) == 0)
{
new id, query[50], Float:x, Float:y, Float:z;
if(sscanf(params, "s[6]d", option, id))
{
SendClientMessage(playerid, COLOR_GREY, "Usage: {FFFFFF}/edithouse exit [ID]");
return 1;
}
HouseInfo[id][server_ID] = id;
GetPlayerPos(playerid, Float:x, Float:y, Float:z);
HouseInfo[id][InteriorPos][0] = x;
HouseInfo[id][InteriorPos][1] = y;
HouseInfo[id][InteriorPos][2] = z;
HouseInfo[id][InteriorWorld] = GetPlayerInterior(playerid);
HouseInfo[id][InteriorInterior] = GetPlayerInterior(playerid);
HouseInfo[id][server_ID] = id;
format(str, sizeof(str), "You've successfully adjusted house id %d's entrance position", HouseInfo[id][server_ID]);
SendClientMessage(playerid, COLOR_GREY, str);
format(query, sizeof(query), "UPDATE houses SET InteriorX='%f', InteriorY='%f', InteriorZ='%f', InteriorWorld='%d', InteriorInterior='%d' WHERE server_ID='%i'",
HouseInfo[id][InteriorPos][0], HouseInfo[id][InteriorPos][1], HouseInfo[id][InteriorPos][2], HouseInfo[id][InteriorWorld], HouseInfo[id][InteriorInterior] ,HouseInfo[id][server_ID]);
mysql_function_query(dbhandle, query , true, "", "");
return 1;
}
Code:
[ERROR] CMySQLQuery::Execute[] - (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
SQL ERROR
Re: SQL error, I can't find anything wrong in here. -
Calisthenics - 26.01.2019
`query` size (50) is too small, increase it.
Re: SQL error, I can't find anything wrong in here. -
ShadowMortar - 26.01.2019
Alright, thanks, fixed, dumb mistake..