[HELP]You cannot call this function now. (Reason: Fields/Rows are empty.)
#1

Hello everybody, well i am getting this problem that is frustrating. I am trying to get some values, from the database but it is not able to find them and says that Fields/Rows are empty.

MYSQL log:

Код:
[21:00:44] CMySQLHandler::Query(SELECT * FROM event_maps WHERE event_type = 3 ) - Successfully executed.

[21:00:44] >> mysql_store_result( Connection handle: 1 )

[21:00:44] CMySQLHandler::StoreResult() - Result was stored.

[21:00:44] >> mysql_num_rows( Connection handle: 1 )

[21:00:44] CMySQLHandler::NumRows() - Returned 1 row(s)

[21:00:44] >> mysql_free_result( Connection handle: 1 )

[21:00:44] CMySQLHandler::FreeResult() - Result was successfully free'd.

[21:00:44] >> mysql_query( Connection handle: 1 )

[21:00:44] CMySQLHandler::Query(SELECT * FROM event_maps WHERE map_id = 6 ) - Successfully executed.

[21:00:44] >> mysql_fetch_field_row( Connection handle: 1 )

[21:00:44] CMySQLHandler::FetchField(map_id) - You cannot call this function now. (Reason: Fields/Rows are empty.)

[21:00:44] >> mysql_fetch_field_row( Connection handle: 1 )

[21:00:44] CMySQLHandler::FetchField(map_name) - You cannot call this function now. (Reason: Fields/Rows are empty.)

[21:00:44] >> mysql_fetch_field_row( Connection handle: 1 )

[21:00:44] CMySQLHandler::FetchField(r_spawnx) - You cannot call this function now. (Reason: Fields/Rows are empty.)

[21:00:44] >> mysql_fetch_field_row( Connection handle: 1 )

[21:00:44] CMySQLHandler::FetchField(r_spawny) - You cannot call this function now. (Reason: Fields/Rows are empty.)

[21:00:44] >> mysql_fetch_field_row( Connection handle: 1 )

[21:00:44] CMySQLHandler::FetchField(r_spawnz) - You cannot call this function now. (Reason: Fields/Rows are empty.)

[21:00:44] >> mysql_fetch_field_row( Connection handle: 1 )

[21:00:44] CMySQLHandler::FetchField(b_spawnx) - You cannot call this function now. (Reason: Fields/Rows are empty.)

[21:00:44] >> mysql_fetch_field_row( Connection handle: 1 )

[21:00:44] CMySQLHandler::FetchField(b_spawny) - You cannot call this function now. (Reason: Fields/Rows are empty.)

[21:00:44] >> mysql_fetch_field_row( Connection handle: 1 )

[21:00:44] CMySQLHandler::FetchField(b_spawnz) - You cannot call this function now. (Reason: Fields/Rows are empty.)

[21:00:44] >> mysql_fetch_field_row( Connection handle: 1 )

[21:00:44] CMySQLHandler::FetchField(map_int) - You cannot call this function now. (Reason: Fields/Rows are empty.)

[21:00:44] >> mysql_fetch_field_row( Connection handle: 1 )

[21:00:44] CMySQLHandler::FetchField(vw) - You cannot call this function now. (Reason: Fields/Rows are empty.)

[21:00:44] >> mysql_free_result( Connection handle: 1 )

[21:00:44] CMySQLHandler::FreeResult() - The result is already empty.

[21:01:44] >> mysql_query( Connection handle: 1 )
the code:

Код:
new MySQLQuery[300],map_name0[129],savingstring[10];//, row;// savingstring[4];
format(MySQLQuery, sizeof MySQLQuery, "SELECT * FROM event_maps WHERE event_type = %d ",TDM);
mysql_query(MySQLQuery);
mysql_store_result();
new rows = mysql_num_rows();
mysql_free_result();
for(new i=0;i<rows;i++)
{
      if(listitem==i)
      { 
		format(MySQLQuery, sizeof MySQLQuery, "SELECT * FROM event_maps WHERE map_id = %d ",eventai[i]);
		mysql_query(MySQLQuery);
		mysql_fetch_field_row(savingstring, "map_id"); map_id = strval(savingstring);
		mysql_fetch_field_row(map_name0, "map_name");
                mysql_fetch_field_row(savingstring, "r_spawnx"); red_spawn[0] = strval(savingstring);
		mysql_fetch_field_row(savingstring, "r_spawny"); red_spawn[1] = strval(savingstring);
		mysql_fetch_field_row(savingstring, "r_spawnz"); red_spawn[2] = strval(savingstring);
		mysql_fetch_field_row(savingstring, "b_spawnx"); blue_spawn[0] = strval(savingstring);
		mysql_fetch_field_row(savingstring, "b_spawny"); blue_spawn[1] = strval(savingstring);
		mysql_fetch_field_row(savingstring, "b_spawnz"); blue_spawn[2] = strval(savingstring);
                mysql_fetch_field_row(savingstring, "map_int"); event_int = strval(savingstring);
		mysql_fetch_field_row(savingstring, "vw"); event_vw = strval(savingstring);
		mysql_free_result();
		new str[129];
		format(str,sizeof(str),"Event: A 'Team Death Match' Event is going to start. Type /event to participate");
		SendClientMessageToAll(lred,str);
		format(str,sizeof(str),"Map Name: %s | Reward: $10,000 and 10 Score | Creator SystemX",map_name);
		SendClientMessageToAll(lred,str);
		event_start=true;
		event_ready=false;
		totalp_red=0;
		totalp_blue=0;
		totalp_event=0;
		SetTimer("start_event",15000,0);
		se_timer=1;
}
and i get issues here. But for instance in the database, that row that was called upon with map_id = 6, does exist and it does actually has values in it.

in a different part of the script i have similar fetch_field_row lines, for when i select a row from events, but then it works fine. Its just here that i am getting this frustrating issue.. Anyone know what the problem is?
Reply
#2

PHP код:
format(MySQLQuerysizeof MySQLQuery"SELECT * FROM event_maps WHERE map_id = %d ",eventai[i]);
mysql_query(MySQLQuery);
mysql_store_result(); // You forgot this :)
mysql_fetch_field_row(savingstring"map_id"); map_id strval(savingstring); 
Reply
#3

So i added that line and the issues is still the same.. for some reason its thinking that theres nothing there.. Any ideas?

Here is also the database and obviously map_id 6, is all filled up nicely.

Reply
#4

Fixed, anyone that has this issue just use mysql_retrieve_row();, after mysql_store_result();
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)