02.04.2019, 12:07
There's an example how to use it - https://sampforum.blast.hk/showthread.php?tid=627520
Place where calling LoadRank function:
public LoadRank();
Place where calling LoadRank function:
Code:
mysql_format(MySQL, query, sizeof(query), "SELECT * FROM rankname"); mysql_tquery(MySQL, query, "LoadRank", #, #);
Code:
forward LoadRank();
public LoadRank()
{
new results = cache_num_rows();
if(results > 0) // if there is any results
{
for(new i = 0; i < results; i++)
{
cache_get_value(i, "name of variable in database", yourStringVariable, size of string); // string
cache_get_value_int(i, "name of variable in database", yourIntVariable); // saving value to the variable
cache_get_value_float(i, "name of variable in database", yourFloatVariable); // saving value to the variable
}
print("Ranks were read");
}
else // There is no results
{
}
return 1;
}

