SA-MP Forums Archive
MySQL - LoadPlayerData Fail - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: MySQL - LoadPlayerData Fail (/showthread.php?tid=439854)



MySQL - LoadPlayerData Fail - S0n1COwnsYou - 27.05.2013

PHP код:
stock LoadPlayerData(PlayerID)
{
    new 
Query[256];
    
format(Query256"SELECT * FROM `users` WHERE `Name` = '%s'"PlayerName(PlayerID));
    
mysql_query(Query);
    
mysql_store_result();
    while(
mysql_fetch_row_format(Query,"|"))
    {
        
/*Password*/
        
format(PlayerInformation[PlayerID][Password], 129"");
        
mysql_fetch_field_row(PlayerInformation[PlayerID][Password], "Password");
        
/*Password*/
        
        /*Score*/
        
PlayerInformation[PlayerID][Score] = 0;
        
mysql_fetch_field_row(PlayerInformation[PlayerID][Score], "Score");
        
SetPlayerScore(PlayerIDPlayerInformation[PlayerID][Score]);
        
/*Score*/
        
        /*Money*/
        
PlayerInformation[PlayerID][Money] = 0;
        
mysql_fetch_field_row(PlayerInformation[PlayerID][Money], "Money");
        
ResetPlayerMoney(PlayerID);
        
GivePlayerMoney(PlayerIDPlayerInformation[PlayerID][Money]);
        
/*Money*/
        
        /*AdminLevel*/
        
PlayerInformation[PlayerID][AdminLevel] = 0;
        
mysql_fetch_field_row(PlayerInformation[PlayerID][AdminLevel], "AdminLevel");
        
/*AdminLevel*/
        
        /*Kills*/
        
PlayerInformation[PlayerID][Kills] = 0;
        
mysql_fetch_field_row(PlayerInformation[PlayerID][Kills], "Kills");
        
/*Kills*/
        
        /*Deaths*/
        
PlayerInformation[PlayerID][Deaths] = 0;
        
mysql_fetch_field_row(PlayerInformation[PlayerID][Deaths], "Deaths");
        
/*Deaths*/
    
}
    
SendClientMessage(PlayerIDSexyBlue"[SERVER]{FFFFFF} You Have Successfully Logged-In.");
    
PlayerInformation[PlayerID][LoggedIn] = 1;
    
mysql_free_result();

its load every thing 48, for example the Score on the database is 1337 , when its load its 49 or 48


Re: MySQL - LoadPlayerData Fail - Vince - 27.05.2013

fetch_field_row expects strings to store the retrieved data, which these variables definitely aren't.


Re: MySQL - LoadPlayerData Fail - S0n1COwnsYou - 27.05.2013

ill try and inform you

FIXED

I LOVE YOU MAN (NO HOMO)