Mysql R7 Loading Problem
#1

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

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]; 
Reply
#3

....
Reply
#4

What is mysql_log saying? Did the query execute correctly?
Reply
#5

Код:
[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.
Reply
#6

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

Can you show me?
Reply
#8

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

Fixed. Thanks for all.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)