MySQL saving problem
#1

Hey guys,

I am currently working on a RP script from scratch and I have been testing it time to time, I only just noticed that the script is not saving anything into the database.. It creates the users just fine, but its saving the users its having problems with..

Below is the codes I have for it to save the players info and stats.
pawn Код:
SavePlayer(playerid)
{
    if(PlayerInfo[playerid][Logged] == 1)
    {
        new Query[500], name[MAX_PLAYER_NAME];
        GetPlayerPos(playerid, PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ]);
        PlayerInfo[playerid][pAge] = GetPlayerSkin(playerid);
        format(Query, 500, "UPDATE `playerdata` SET `admin` = '%d', `age` = '%d', `gender` = '%d',`level` = '%d', `exp` = %d, `money` = '%d', `kills` = '%d', `deaths` = '%d', `faction` = '%d', `rank` = '%d', `division` = '%d', `interior` = '%i', `world` = '%i', `x` = '%f', `y` = '%f', `z` = '%f', `a` = '%f', `skin` = '%d', `gang` = '%d', `grank` = '%d', `license` = '%d', `cdl` = '%d', `weplic` = '%d' WHERE `id` = '%d' LIMIT 1",
        PlayerInfo[playerid][pAdmin],
        PlayerInfo[playerid][pAge],
        PlayerInfo[playerid][pGender],
        PlayerInfo[playerid][pLevel],
        PlayerInfo[playerid][pExp],
        PlayerInfo[playerid][pMoney],
        PlayerInfo[playerid][pKills],
        PlayerInfo[playerid][pDeaths],
        PlayerInfo[playerid][pFaction],
        PlayerInfo[playerid][pRank],
        PlayerInfo[playerid][pDivision],
        PlayerInfo[playerid][pInterior],
        PlayerInfo[playerid][pWorld],
        PlayerInfo[playerid][pX],
        PlayerInfo[playerid][pY],
        PlayerInfo[playerid][pZ],
        PlayerInfo[playerid][pA],
        PlayerInfo[playerid][pSkin],
        PlayerInfo[playerid][pGang],
        PlayerInfo[playerid][gRank],
        PlayerInfo[playerid][pLicense],
        PlayerInfo[playerid][pCDL],
        PlayerInfo[playerid][pWepLic],
        PlayerInfo[playerid][ID]);
        mysql_query(Query);
    }
}
If you need anything else like logs etc. please ask politely
Reply
#2

Debug.txt?
Reply
#3

I miss registring Name, maybe it's the problem !
Name is not used !
Reply
#4

I don't know hot to get the debug.txt and at FilesMaker what do you mean?
Reply
#5

Add:

pawn Код:
mysql_debug(1);
On to the callback:

pawn Код:
OnGameModeInIt()
Reply
#6

Just forget I'm not skilled on SQL
You are not using Name String that all :
Код:
new Query[500], this -- > name[MAX_PLAYER_NAME] < -- is not used;
Reply
#7

@Brandon when I add that it says undefined name, and At Files, it does not work.
Reply
#8

Can anyone help me? Please!
Reply
#9

Please I need someone to help me!!
Reply
#10

What MySQL version you are using?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)