Mysql fieldcontent fetching attempt brings warning - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Mysql fieldcontent fetching attempt brings warning (
/showthread.php?tid=518567)
Mysql fieldcontent fetching attempt brings warning -
IKnowWhatIAmDoing - 10.06.2014
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')
Re: Mysql fieldcontent fetching attempt brings warning -
IKnowWhatIAmDoing - 11.06.2014
Bump
Re: Mysql fieldcontent fetching attempt brings warning -
IKnowWhatIAmDoing - 12.06.2014
Bump