Mysql fieldcontent fetching attempt brings warning
#1

I need alternative way for getting the result, because this one gives an warning, or telling me how to fix it can help too.

The code below works but the warning bothers me so I want to learn how to fix it

pawn Код:
format(string, 256, "SELECT `Baninfo` FROM `samp` WHERE `ID`= %d",PlayerInfo[playerid][ID]);
mysql_query(cn,string);
mysql_store_result();
if(mysql_num_rows() > 0)
{
  while(mysql_fetch_row(string))
  {
   cache_get_field_content(0, "Baninfo", bandata, SQL, 64); // I tried changing that 0 to 1 but still same
   sscanf(string, "s[64]",bandata);
   }
}
mysql_free_result();
Код:
[15:44:02] [DEBUG] CMySQLResult::GetRowData - row: '0', field: '0', data: "Not Banned"
[15:44:02] [DEBUG] cache_get_field_content - row: 1, field_name: "Baninfo", connection: 1, max_len: 64
[15:44:02] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('1')
[15:44:02] [DEBUG] cache_get_row_count - connection: 1
[15:44:02] [DEBUG] cache_get_field_count - connection: 1
[15:44:02] [DEBUG] cache_get_row - row: 1, field_idx: 0, connection: 1, max_len: 512
[15:44:02] [WARNING] CMySQLResult::GetRowData - invalid row ('1') or field index ('0')
Reply
#2

Bump
Reply
#3

Bump
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)