22.11.2014, 19:23
Hello, I have a question. How can I make array size by mysql_num_rows? I doing this:
But in this situation I can't use array in any code position. I want to load all info in player login and use in all code.
Loaded info is string.
Код:
LoadSomethingToArray(playerid)
{
mysql_query("SELECT * FROM table");
mysql_store_result();
new array[MAX_PLAYERS][mysql_num_rows()];
for(new i=0; i<mysql_num_rows(); i++)
{
format(query, sizeof(query), "SELECT * FROM table WHERE ID=%i", i);
mysql_query(query);
mysql_retrieve_row();
mysql_fetch_field_row(fetch, "SomeCol");
array[playerid][i] = fetch;
mysql_free_result();
}
}
Loaded info is string.


