SA-MP Forums Archive
Mysql R7 Loading Problem - 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 R7 Loading Problem (/showthread.php?tid=471443)



Mysql R7 Loading Problem - HardRock - 23.10.2013

PHP код:
    format(querysizeof(query), "SELECT * FROM kasutajad WHERE Nimi = '%s' LIMIT 0,1"PlayerName(playerid));
     
mysql_function_query(SQLquerytrue"OnPlayerDataLoad""is[256]"playeridquery); 
PHP код:
forward OnPlayerDataLoad(playeridquery);
public 
OnPlayerDataLoad(playeridquery)
{
    
SendClientMessage(playeridCOLOR_ORANGE"Please wait...");
    new 
rowsfieldsstring[256];
    
cache_get_data(rowsfields);
    if(!
rows)
    {
        
N2itaDialog(playerid0);
    }
    else
    {
        
format(stringsizeof(string), "%s"query);
        
sscanf(query"e<p<|>s[16]s[64]s[256]iiiiis[64]s[64]s[64]iis[64]s[64]s[64]i>"KasutajaInfo[playerid]);
        
N2itaDialog(playerid1);
    }
    return 
1;

-----------------------------------------------------------------------------

Why he dont load player data?

KasutajaInfo[playerid][pPassword] is empty, but in database is:


-----------------------------------------------------------------------------

Код:
B913D5BBB8E461C2C5961CBE0EDCDADFD29F068225CEB37DA6DEFCF89849368F8C6C2EB6A4C4AC75775D032A0ECFDFE8550573062B653FE92FC7B8FB3B7BE8D6



Re: Mysql R7 Loading Problem - HardRock - 23.10.2013

Enum

PHP код:
enum pAndmed
{
    
pIP[16],
     
pNimi[MAX_PLAYER_NAME],
    
pPassword[128],
    
pRaha,
    
pVanus,
    
pSQLID,
    
pSkin,
    
pHoiatused,
    
pHoiatus1[64],
    
pHoiatus2[64],
    
pHoiatus3[64],
    
pAdmin,
    
pAdminTase,
    
pAdminParool[64],
     
pBanPohjus[64],
      
pBannija[64],
      
pBanned
}
new 
KasutajaInfo[MAX_PLAYERS][pAndmed]; 



Re: Mysql R7 Loading Problem - HardRock - 23.10.2013

....


Re: Mysql R7 Loading Problem - Misiur - 23.10.2013

What is mysql_log saying? Did the query execute correctly?


Re: Mysql R7 Loading Problem - HardRock - 23.10.2013

Код:
[08:13:54] >> mysql_query_callback( Connection handle: 1 )
[08:13:54] Passing query SELECT * FROM kasutajad WHERE Nimi = 'Test' LIMIT 0,1 | is[500]
[08:13:54] ProcessQueryThread(OnPlayerDataLoad) - Query was successful. (SELECT * FROM kasutajad WHERE Nimi = 'Test' LIMIT 0,1)
[08:13:54] ProcessQueryThread(OnPlayerDataLoad) - Data caching enabled.
[08:13:54] CMySQLHandler::StoreResult() - Result was stored.
[08:13:54] CMySQLHandler::FreeResult() - Result was successfully free'd.
[08:13:54] CMySQLHandler::ProcessQueryThread() - Data is getting passed to ->ProcessTick()
[08:13:54] OnPlayerDataLoad(is[500]) - Threaded function called.
[08:13:54] >> cache_get_data( Connection handle: 1 )
[08:13:54] ProcessTick() - The cache has been cleared.



Re: Mysql R7 Loading Problem - Konstantinos - 23.10.2013

Try with cache_get_row function.

After storing the result in a string, convert it to integers with strval.
For the strings, you can add the array in cache_get_row directly without copying a temporary string to the one you want, but don't forget the lenght at the end.


Re: Mysql R7 Loading Problem - HardRock - 23.10.2013

Can you show me?


Re: Mysql R7 Loading Problem - Misiur - 23.10.2013

Here you go
https://sampforum.blast.hk/showthread.php?tid=337810


Re: Mysql R7 Loading Problem - HardRock - 24.10.2013

Fixed. Thanks for all.