Multiple Line MYSQL -
Dreandor - 16.06.2018
I want to make for my PlayerSave multiple lines.
PHP код:
mysql_format(handle, query, sizeof(query), "UPDATE users SET level = '%d', leben = '%d', holz = '%d', stein = '%d', eisen = '%d',", PlayerInfo[playerid][pLevel], PlayerInfo[playerid][pLeben], PlayerInfo[playerid][pHolz], PlayerInfo[playerid][pStein], PlayerInfo[playerid][pEisen]);
mysql_format(handle, query, sizeof(query), "%s map = '%d', recht = '%d', alive = '%d',",PlayerInfo[playerid][pMap], PlayerInfo[playerid][pRecht], PlayerInfo[playerid][pAlive]);
mysql_format(handle, query, sizeof(query), "%s posx = '%f', posy = '%f', posz = '%f', posarg = '%f',",PlayerInfo[playerid][pPosx], PlayerInfo[playerid][pPosy], PlayerInfo[playerid][pPosz], PlayerInfo[playerid][pPosArg]);
mysql_format(handle, query, sizeof(query), "%s skinid = '%d' WHERE id = '%d'", PlayerInfo[playerid][pSkinid], PlayerInfo[playerid][pID]);
mysql_pquery(handle, query);
But this Error comes:
Код:
[21:48:24] [ERROR] mysql_format: no value for specifier '%d' passed
[21:48:24] [ERROR] mysql_format: no value for specifier '%f' passed
[21:48:24] [ERROR] mysql_format: no value for specifier '%d' passed
[21:48:24] [ERROR] error #1064 while executing query "UPDATE users SET level = '0', leben = '1', holz = '100', stein = '100', eisen = '100',": You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1
Re: Multiple Line MYSQL -
KaryM4Life - 16.06.2018
You did not put values for the specifiers as mentioned in the error messages.
Re: Multiple Line MYSQL -
Dreandor - 16.06.2018
PHP код:
new Float:x, Float:y, Float:z, Float:ang;
new skin;
GetPlayerPos(playerid, x, y, z);
skin = GetPlayerCustomSkin(playerid);
GetPlayerFacingAngle(playerid, ang);
PlayerInfo[playerid][pPosx] = x;
PlayerInfo[playerid][pPosy] = y;
PlayerInfo[playerid][pPosz] = z;
PlayerInfo[playerid][pPosArg] = ang;
PlayerInfo[playerid][pAlive] = 1;
PlayerInfo[playerid][pSkinid] = skin;
Re: Multiple Line MYSQL -
Calisthenics - 16.06.2018
You try to re-format the query and use %s placeholder at the beginning but you forgot the argument.
pawn Код:
mysql_format(handle, query, sizeof(query), "%s map = '%d', recht = '%d', alive = '%d',", query, PlayerInfo[playerid][pMap], PlayerInfo[playerid][pRecht], PlayerInfo[playerid][pAlive]);
mysql_format(handle, query, sizeof(query), "%s posx = '%f', posy = '%f', posz = '%f', posarg = '%f',", query, PlayerInfo[playerid][pPosx], PlayerInfo[playerid][pPosy], PlayerInfo[playerid][pPosz], PlayerInfo[playerid][pPosArg]);
mysql_format(handle, query, sizeof(query), "%s skinid = '%d' WHERE id = '%d'", query, PlayerInfo[playerid][pSkinid], PlayerInfo[playerid][pID]);
Re: Multiple Line MYSQL -
Dreandor - 16.06.2018
Thanks. It worked