SA-MP Forums Archive
Is the string too small for this query, or am I looking at it wrong? - 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: Is the string too small for this query, or am I looking at it wrong? (/showthread.php?tid=544335)



Is the string too small for this query, or am I looking at it wrong? - sammp - 01.11.2014

Код:
[12:04:05] [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 '`level` = '0', `SpawnLoc` = '0', `int` = '0', `vw` = '0' WHERE `Username` = 'Arn' at line 1
I wouldn't imagine the string is too small as it is called VAR3000[3000];??


Re: Is the string too small for this query, or am I looking at it wrong? - Runn3R - 01.11.2014

Post the format line here.


Re: Is the string too small for this query, or am I looking at it wrong? - sammp - 01.11.2014

pawn Код:
format(VAR3000, sizeof(VAR3000), "UPDATE `samp_users` SET `money` = '%d', `skin` = '%d', `age` = '%d', `ip` = '%s', `health` = '%f', `armour` = '%f', `gender` = '%d', `faction` = '%d', `pDisX` = '%f', `pDisY` = '%f', `pDisZ` = '%f', `pDisA` = '%f' `level` = '%d', `SpawnLoc` = '%d', `int` = '%d', `vw` = '%d' WHERE `Username` = '%e'",
        Account[playerid][Money], Account[playerid][pSkin], Account[playerid][pAge], PlayerIP[playerid],
        Account[playerid][pHealth], Account[playerid][pArmour], Account[playerid][pGender], faction, pX1, pY1, pZ1, A, Account[playerid][pLevel], spawnLoc, interior, virtualWorld, Name[playerid]);



Re: Is the string too small for this query, or am I looking at it wrong? - Tamer - 01.11.2014

pawn Код:
format(VAR3000, sizeof(VAR3000), "UPDATE `samp_users` SET `money` = '%d', `skin` = '%d', `age` = '%d', `ip` = '%s', `health` = '%f', `armour` = '%f', `gender` = '%d', `faction` = '%d', `pDisX` = '%f', `pDisY` = '%f', `pDisZ` = '%f', `pDisA` = '%f', `level` = '%d', `SpawnLoc` = '%d', `int` = '%d', `vw` = '%d' WHERE `Username` = '%e'",
        Account[playerid][Money], Account[playerid][pSkin], Account[playerid][pAge], PlayerIP[playerid],
        Account[playerid][pHealth], Account[playerid][pArmour], Account[playerid][pGender], faction, pX1, pY1, pZ1, A, Account[playerid][pLevel], spawnLoc, interior, virtualWorld, Name[playerid]);
Try this.

You forgot a comma right over here.

format(VAR3000, sizeof(VAR3000), "UPDATE `samp_users` SET `money` = '%d', `skin` = '%d', `age` = '%d', `ip` = '%s', `health` = '%f', `armour` = '%f', `gender` = '%d', `faction` = '%d', `pDisX` = '%f', `pDisY` = '%f', `pDisZ` = '%f', `pDisA` = '%f' ,`level` = '%d', `SpawnLoc` = '%d', `int` = '%d', `vw` = '%d' WHERE `Username` = '%e'", Account[playerid][Money], Account[playerid][pSkin], Account[playerid][pAge], PlayerIP[playerid],
Account[playerid][pHealth], Account[playerid][pArmour], Account[playerid][pGender], faction, pX1, pY1, pZ1, A, Account[playerid][pLevel], spawnLoc, interior, virtualWorld, Name[playerid]);


Re: Is the string too small for this query, or am I looking at it wrong? - sammp - 01.11.2014

Fixed it,

forgot to add a few fields