help mysql
#1

heeeeeeelp


Quote:

[01:23:24] [ERROR] ID: 1064 - Error: 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 ''0.0' at line 1 - Callback - OnQueryFinish - Query: UPDATE `usuarios` SET `Vida`='0.000000', `Chaleco`='0.000000', `Admin`='100', `Faccion`='0', `Posx`='50.000000', `Posy`='50.000000', `Posz`='50.000000', `Interiorid`='0.000000', `Virtualworldid`='0.0

Quote:

new query[200];GetPlayerPos(playerid, UserInfo[playerid][pPosx], UserInfo[playerid][pPosy], UserInfo[playerid][pPosz]);
new pName[24];
GetPlayerName(playerid, pName, 24);
GetPlayerHealth(playerid, UserInfo[playerid][pVida]), GetPlayerArmour(playerid, UserInfo[playerid][pChaleco]);
format(query, 200, "UPDATE `usuarios` SET `Vida`='%f', `Chaleco`='%f', `Admin`='%d', `Faccion`='%d', `Posx`='%f', `Posy`='%f', `Posz`='%f', `Interiorid`='%f', `Virtualworldid`='%f' WHERE `Nombre`='%s'", UserInfo[playerid][pVida], UserInfo[playerid][pChaleco],
UserInfo[playerid][pAdmin], UserInfo[playerid][pFaccion], UserInfo[playerid][pPosx], UserInfo[playerid][pPosy], UserInfo[playerid][pPosz], UserInfo[playerid][interiorid], UserInfo[playerid][virtualworldid], pName);
mysql_function_query(Conecction, query, true, "OnQueryFinish", "ii", 0, playerid);

Reply
#2

Maybe the query holding variable size is too low, increase the variable size and also don't forget to increase its size in format() line.
And also virtual world is supposed to be integer not float so why use %f in the format line for it?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)