What's wrong?! - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Server (
https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (
https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: What's wrong?! (
/showthread.php?tid=477114)
What's wrong?! -
Tingesport - 22.11.2013
Код:
[14:06:33] CMySQLHandler::Query(UPDATE playerdata SET Level=1, Money=500, IP=127.0.0.1, Admin=0, Skin=299, Armour=0.000000, Health=0.000000, ConnectTime=1, PosX=50.000000, PosY=50.000000, PosZ=50.000000, PosA=0.000000, VirtualWorld) - 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 '.0.1, Admin=0, Skin=299, Armour=0.000000, Health=0.000000, ConnectTime=1, PosX=5' at line 1)
pawn Код:
format(query, sizeof(query), "UPDATE playerdata SET Level=%d, Money=%d, IP=%s, Admin=%d, Skin=%d, Armour=%f, Health=%f, \
ConnectTime=%d, PosX=%f, PosY=%f, PosZ=%f, PosA=%f, VirtualWorld=%d, Interior=%d WHERE Username = %s",
score, money,
ip, pInfo[playerid][pAdmin],
skin, a,
h, pInfo[playerid][pConnectTime],
x, y, z, an, vw,
inter, pName(playerid));
Re: What's wrong?! -
Konstantinos - 22.11.2013
Use ' ' around %s placeholder.
pawn Код:
format(query, sizeof(query), "UPDATE playerdata SET Level=%d, Money=%d, IP='%s', Admin=%d, Skin=%d, Armour=%f, Health=%f, \
ConnectTime=%d, PosX=%f, PosY=%f, PosZ=%f, PosA=%f, VirtualWorld=%d, Interior=%d WHERE Username = '%s'",
EDIT: You should've posted in Scripting Help section.