29.06.2011, 16:05
I've been working on a house system, and I've made a command to add houses while in game. But, I seem to have messed something up. Here's my command:
Error:
Код:
COMMAND:createhouse(playerid, params[]) { new query[65],Float:x,Float:y,Float:z,name[64],cost; if(!sscanf(params, "si", name, cost)) { GetPlayerPos(playerid, x, y, z); format(query,sizeof(query),"INSERT INTO [REMOVED] (Name, Cost, PosX, PosY, PosZ) VALUES ('%s', '%d', '%s', '%s', '%s')",name,cost,x,y,z); mysql_query(query); SendCommandToAdmins(playerid, 4, "/addhouse"); } return 1; }
Код:
[16:05:01] CMySQLHandler::Query(INSERT INTO [REMOVED] (Name, Cost, PosX, PosY, PosZ) VALUES ('Visag) - An error has occured. (Error ID: 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 ''Visag' at line 1) [16:05:09] >> mysql_ping( Connection handle: 1 )