MySQL - LoadPlayerData Fail
#1

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
Reply
#2

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

ill try and inform you

FIXED

I LOVE YOU MAN (NO HOMO)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)