Help data won't load from MySQL
#1

Hey all, i have some problem when load player data from database.
Please help me, i can't fix it.
There's the script.
Код:
stock LoadPlayerInfo(playerid)
{
	new
		Query[67],dkills, ddeaths, dmoney, dlevel, dexp, dexpL, pname[16];
	mysql_real_escape_string(pName(playerid), pname);

    format(Query, sizeof(Query), "SELECT `kills`,`deaths`,`money`,`Level`,`EXP`,`EXP_L` FROM `playerinfo` WHERE `user` = '%s'", pname);
    mysql_query(Query);
    mysql_store_result();
    if(mysql_num_rows() > 0)
    {
        while(mysql_fetch_row(Query))
        {
            sscanf(Query, "p<|>iffff", dkills, ddeaths, dmoney, dlevel, dexp, dexpL);
			PVar[playerid][pKills] = dkills;
			PVar[playerid][pDeaths] = ddeaths;
			GivePlayerMoney(playerid, dmoney);
			PVar[playerid][pLevel] = dlevel;
			PVar[playerid][pExp] = dexp;
			PVar[playerid][pExpL] = dexpL;
		}
    }

	format(Msg, sizeof(Msg), "DATA : %d %d %d %d %d %d", dkills, ddeaths, dmoney, dlevel, dexp, dexpL);
	SendClientMessage(playerid, COLOR_CADETBLUE, Msg);
    mysql_free_result();
    
	return 1;
}
Can you help me to fix it?
Thanks
Reply


Messages In This Thread
Help data won't load from MySQL - by X337 - 23.10.2014, 11:32
Re: Help data won't load from MySQL - by AzaMx - 23.10.2014, 14:45
Re: Help data won't load from MySQL - by dusk - 23.10.2014, 17:31

Forum Jump:


Users browsing this thread: 2 Guest(s)