Array size by MySQL rows number?
#1

Hello, I have a question. How can I make array size by mysql_num_rows? I doing this:
Код:
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();
       }
}
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.
Reply


Messages In This Thread
Array size by MySQL rows number? - by Stuneris - 22.11.2014, 19:23
Re: Array size by MySQL rows number? - by Vince - 22.11.2014, 19:33
Re: Array size by MySQL rows number? - by Stuneris - 22.11.2014, 19:38
Re : Array size by MySQL rows number? - by Dutheil - 22.11.2014, 19:47
Re: Array size by MySQL rows number? - by PowerPC603 - 22.11.2014, 21:12

Forum Jump:


Users browsing this thread: 1 Guest(s)