SA-MP Forums Archive
MySQL Cache - 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 Cache (/showthread.php?tid=625364)



MySQL Cache - Yaa - 31.12.2016

Code:

PHP код:
public OnMySQLValided(playerid

        
cache_get_value_name_int(0"Admin"PlayerInfo[playerid][Admin]); 
        
cache_get_value_name_int(0"VIP"PlayerInfo[playerid][VIP]); 
        
cache_get_value_name_int(0"Money"PlayerInfo[playerid][Money]); 
        
cache_get_value_name(0"DeathMessage"PlayerInfo[playerid][pDM]);
        
cache_get_value_name_int(0"Deaths"PlayerInfo[playerid][pDeaths]);
        
cache_get_value_name_int(0"Kills"PlayerInfo[playerid][pKills]);
        
cache_get_value_name_int(0"Bans"PlayerInfo[playerid][pBans]);
        
cache_get_value_name_int(0"Kicks"PlayerInfo[playerid][pKicks]);
        
cache_get_value_name_int(0"Car"MyCar[playerid]);
    new 
query[150];
    
mysql_format(registerquerysizeof(query), "SELECT * FROM `accounts_2` WHERE `Name` = '%s' LIMIT 1"GetName(playerid));
    
mysql_tquery(registerquery"LoadPlayersHours""i"playerid);
    return 
1
}  
public 
LoadPlayersHours(playerid)
{
    
cache_get_value_name_int(0"Hours"PlayerInfo[playerid][pHours]);
    
cache_get_value_name_int(0"Minutes"PlayerInfo[playerid][pMin]);
    
cache_get_value_name_int(0"BankValue"BankInfo[playerid][Deposit]);
    
cache_get_value_name_int(0"SkinID"PlayerInfo[playerid][pSkin]);
    
TogglePlayerSpectating(playeridfalse); 
    
GivePlayerMoney(playeridPlayerInfo[playerid][Money]); 
    
SendClientMessage(playerid, -1"You have successfully logged in."); 
    
SetSpawnInfo(playerid0PlayerInfo[playerid][pSkin], 1958.331343.1215.36269.152636281500);
    return 
1;

Errors:

PHP код:
[13:53:24] [plugins/mysqlcache_get_value_name_intinvalid row index '0' (number of rows'0') (D:\pawn-editor\include\VCData\Server\Functions.pwn:18)
[
13:53:24] [plugins/mysqlcache_get_value_name_intinvalid row index '0' (number of rows'0') (D:\pawn-editor\include\VCData\Server\Functions.pwn:19)
[
13:53:24] [plugins/mysqlcache_get_value_name_intinvalid row index '0' (number of rows'0') (D:\pawn-editor\include\VCData\Server\Functions.pwn:20)
[
13:53:24] [plugins/mysqlcache_get_value_nameinvalid row index '0' (number of rows'0') (D:\pawn-editor\include\VCData\Server\Functions.pwn:21)
[
13:53:24] [plugins/mysqlcache_get_value_name_intinvalid row index '0' (number of rows'0') (D:\pawn-editor\include\VCData\Server\Functions.pwn:22)
[
13:53:24] [plugins/mysqlcache_get_value_name_intinvalid row index '0' (number of rows'0') (D:\pawn-editor\include\VCData\Server\Functions.pwn:23)
[
13:53:24] [plugins/mysqlcache_get_value_name_intinvalid row index '0' (number of rows'0') (D:\pawn-editor\include\VCData\Server\Functions.pwn:24)
[
13:53:24] [plugins/mysqlcache_get_value_name_intinvalid row index '0' (number of rows'0') (D:\pawn-editor\include\VCData\Server\Functions.pwn:25)
[
13:53:24] [plugins/mysqlcache_get_value_name_intinvalid row index '0' (number of rows'0') (D:\pawn-editor\include\VCData\Server\Functions.pwn:26)
[
13:53:24] [plugins/mysqlcache_get_value_name_intinvalid row index '0' (number of rows'0') (D:\pawn-editor\include\VCData\Server\Functions.pwn:46)
[
13:53:24] [plugins/mysqlcache_get_value_name_intinvalid row index '0' (number of rows'0') (D:\pawn-editor\include\VCData\Server\Functions.pwn:47)
[
13:53:24] [plugins/mysqlcache_get_value_name_intinvalid row index '0' (number of rows'0') (D:\pawn-editor\include\VCData\Server\Functions.pwn:48)
[
13:53:24] [plugins/mysqlcache_get_value_name_intinvalid row index '0' (number of rows'0') (D:\pawn-editor\include\VCData\Server\Functions.pwn:49
Thanks in advence


Re: MySQL Cache - SoLetsGO - 31.12.2016

Well it shows number of rows = 0 which means that there is nothing found. Where do you create the mysql query and are you sure that there is data in the table?


Re: MySQL Cache - Yaa - 31.12.2016

Quote:
Originally Posted by SoLetsGO
Посмотреть сообщение
Well it shows number of rows = 0 which means that there is nothing found. Where do you create the mysql query and are you sure that there is data in the table?
Yes I'm sure