Won't load MySQL Data, Could someone explain why?
#1

pawn Код:
LoadAccount(playerid)
{
    new QueryString[128];
    mysql_query( "SELECT * FROM accounts WHERE `id` = %d", PlayerSQLID[playerid]);
    mysql_store_result();
    while(mysql_retrieve_row())
        {
                mysql_get_field( "Armour", QueryString);
                PlayerArmour[playerid] = floatstr( QueryString);
                SetPlayerArmour(playerid, PlayerArmour[playerid]);

                mysql_get_field( "Level", QueryString);
                PlayerLevel[playerid] = strval(QueryString);
                SetPlayerScore(playerid, PlayerLevel[playerid]);

                mysql_get_field( "Money", QueryString);
                PlayerMoney[playerid] = strval(QueryString);
                ResetPlayerMoney(playerid);
                GivePlayerMoney(playerid, PlayerMoney[playerid]);
               
                Report[playerid] = 0;
                AdminDuty[playerid] = 0;

                new ip[16];

                GetPlayerIp(playerid, ip, sizeof(ip));
                MySQL_SetString(PlayerSQLID[playerid], "PlayerIP",ip, "accounts");


                mysql_get_field( "AdminLevel", QueryString);
                AdminLevel[playerid] = strval(QueryString);

                mysql_get_field( "UsingAccent", QueryString);
                UsingAccent[playerid] = strval(QueryString);

                if(UsingAccent[playerid] == 1)
                {
                    LoadPlayerAccent(playerid);
                }

                mysql_get_field( "Faction", QueryString);
                Faction[playerid] = strval(QueryString);
               
                mysql_get_field( "FRank", QueryString);
                FRank[playerid] = strval(QueryString);

                mysql_get_field( "WepTime", QueryString);
                WepTime[playerid] = strval(QueryString);
               
                mysql_get_field( "WepID", QueryString);
                WepID[playerid] = strval(QueryString);
               
                mysql_get_field( "Skin", QueryString);
                PlayerSkin[playerid] = strval(QueryString);
               
                mysql_get_field( "HouseOwned", QueryString);
                HouseOwned[playerid] = strval(QueryString);

                mysql_get_field( "TotalTime", QueryString);
                TotalTime[playerid] = strval(QueryString);
               
                mysql_get_field( "Radio", QueryString);
                Radio[playerid] = strval(QueryString);
               
                mysql_get_field( "RadioFreq", QueryString);
                RadioFreq[playerid] = strval(QueryString);
               
                mysql_get_field( "Cellphone", QueryString);
                Cellphone[playerid] = strval(QueryString);

                mysql_get_field( "Phonebook", QueryString);
                Phonebook[playerid] = strval(QueryString);

                mysql_get_field( "Rope", QueryString);
                Rope[playerid] = strval(QueryString);

                mysql_get_field( "Cocaine", QueryString);
                Cocaine[playerid] = strval(QueryString);

                mysql_get_field( "Weed", QueryString);
                Weed[playerid] = strval(QueryString);
               
                mysql_get_field( "Jail", QueryString);
                Jail[playerid] = strval(QueryString);

                mysql_get_field( "BizOwned", QueryString);
                BizOwned[playerid] = strval(QueryString);

                mysql_get_field( "VMarker", QueryString);
                VMarker[playerid] = strval(QueryString);

                mysql_get_field( "FMarker", QueryString);
                FMarker[playerid] = strval(QueryString);

                mysql_get_field( "NMarker", QueryString);
                NMarker[playerid] = strval(QueryString);
               
                mysql_get_field( "SGrip", QueryString);
                SGrip[playerid] = strval(QueryString);

                mysql_get_field( "MGrip", QueryString);
                MGrip[playerid] = strval(QueryString);

                mysql_get_field( "LGrip", QueryString);
                LGrip[playerid] = strval(QueryString);
               
                mysql_get_field( "SFrame", QueryString);
                SFrame[playerid] = strval(QueryString);

                mysql_get_field( "MFrame", QueryString);
                MFrame[playerid] = strval(QueryString);

                mysql_get_field( "LFrame", QueryString);
                LFrame[playerid] = strval(QueryString);
               
                mysql_get_field( "SBarrel", QueryString);
                SBarrel[playerid] = strval(QueryString);

                mysql_get_field( "MBarrel", QueryString);
                MBarrel[playerid] = strval(QueryString);

                mysql_get_field( "LBarrel", QueryString);
                LBarrel[playerid] = strval(QueryString);
               
                mysql_get_field( "AdminJail", QueryString);
                AdminJail[playerid] = strval(QueryString);
         }
    mysql_free_result();
    return 1;
}
Reply


Messages In This Thread
Won't load MySQL Data, Could someone explain why? - by Dokins - 02.04.2014, 22:16
Re: Won't load MySQL Data, Could someone explain why? - by Jefff - 02.04.2014, 22:28
Re: Won't load MySQL Data, Could someone explain why? - by Dokins - 02.04.2014, 22:33
Re: Won't load MySQL Data, Could someone explain why? - by iZN - 02.04.2014, 22:36
Re: Won't load MySQL Data, Could someone explain why? - by Jefff - 02.04.2014, 22:42
Re: Won't load MySQL Data, Could someone explain why? - by Dokins - 02.04.2014, 22:47

Forum Jump:


Users browsing this thread: 2 Guest(s)