Multiple Line MYSQL
#1

I want to make for my PlayerSave multiple lines.

PHP код:
mysql_format(handlequerysizeof(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(handlequerysizeof(query), "%s map = '%d', recht = '%d', alive = '%d',",PlayerInfo[playerid][pMap], PlayerInfo[playerid][pRecht], PlayerInfo[playerid][pAlive]);
    
mysql_format(handlequerysizeof(query), "%s posx = '%f', posy = '%f', posz = '%f', posarg = '%f',",PlayerInfo[playerid][pPosx], PlayerInfo[playerid][pPosy], PlayerInfo[playerid][pPosz], PlayerInfo[playerid][pPosArg]);
    
mysql_format(handlequerysizeof(query), "%s skinid = '%d' WHERE id = '%d'"PlayerInfo[playerid][pSkinid], PlayerInfo[playerid][pID]);
     
mysql_pquery(handlequery); 
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
Reply
#2

You did not put values for the specifiers as mentioned in the error messages.
Reply
#3

PHP код:
new Float:xFloat:yFloat:zFloat:ang;
    new 
skin;
    
GetPlayerPos(playeridxyz);
    
skin GetPlayerCustomSkin(playerid);
    
GetPlayerFacingAngle(playeridang);
    
PlayerInfo[playerid][pPosx] = x;
    
PlayerInfo[playerid][pPosy] = y;
    
PlayerInfo[playerid][pPosz] = z;
    
PlayerInfo[playerid][pPosArg] = ang;
    
PlayerInfo[playerid][pAlive] = 1;
    
PlayerInfo[playerid][pSkinid] = skin
Reply
#4

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]);
Reply
#5

Thanks. It worked
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)