Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

MySQL how get all variables from table at once

$
0
0
I made mysql connection in my gamemode.
But when i login, server needs 2678 miliseconds for loading all variables at once.

That is too much for me, also i tested with Y_ini system which read fast those variables, and with him is not so.

I'm interested in your opinion
I'm using MYSQL R39 version

PHP Code:

CONNECT
{
    new 
query[100], playername[MAX_PLAYER_NAME];
    
GetPlayerName(playeridplayernamesizeof(playername));
    
mysql_format(mysqlquerysizeof(query), "SELECT * FROM `Players` WHERE `Name` = '%e' LIMIT 1"playername);
    
mysql_tquery(mysqlquery"OnAccountLoad""i"playerid);
}


LOAD
{
    
forward OnAccountLoad(playerid);
    public 
OnAccountLoad(playerid)
    {
        
PlayerInfo[playerid][pLevel] = cache_get_field_content_int(0"Level");
        
PlayerInfo[playerid][pPosX] = cache_get_field_content_float(0"PosX");
        
PlayerInfo[playerid][pPosY] = cache_get_field_content_float(0"PosY");
        
PlayerInfo[playerid][pPosZ] = cache_get_field_content_float(0"PosZ");
        
PlayerInfo[playerid][pPosA] = cache_get_field_content_float(0"PosA");
        
PlayerInfo[playerid][pHealth] = cache_get_field_content_float(0"Health");
        
PlayerInfo[playerid][pArmor] = cache_get_field_content_float(0"Armor");
        .
        .
        .
        .
        .
        
200 Variables like those is here
        
return 1;
    }


Sorry for my bad writting in English i hope you understand me.

Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>