Hi all. I wrote a stats plugin few weeks ago. Suddenly i saw a log, with some errors in it.
Code:
L 03/09/2008 - 00:04:49: Start of error session.
L 03/09/2008 - 00:04:49: Info (map "cs_militia") (file "addons/amxmodx/logs/error_20080309.log")
L 03/09/2008 - 00:04:49: [MySQL] No result set in this query!
L 03/09/2008 - 00:04:49: [AMXX] Displaying debug trace (plugin "xtcs_userstats.amxx")
L 03/09/2008 - 00:04:49: [AMXX] Run time error 10: native error (native "SQL_ReadResult")
L 03/09/2008 - 00:04:49: [AMXX] [0] xtcs_userstats.sma::client_disconnect (line 94)
L 03/09/2008 - 00:04:49: [MySQL] No result set in this query!
L 03/09/2008 - 00:04:49: [AMXX] Displaying debug trace (plugin "xtcs_userstats.amxx")
L 03/09/2008 - 00:04:49: [AMXX] Run time error 10: native error (native "SQL_ReadResult")
L 03/09/2008 - 00:04:49: [AMXX] [0] xtcs_userstats.sma::client_disconnect (line 94)
L 03/09/2008 - 00:04:49: [MySQL] No result set in this query!
L 03/09/2008 - 00:04:49: [AMXX] Displaying debug trace (plugin "xtcs_userstats.amxx")
L 03/09/2008 - 00:04:49: [AMXX] Run time error 10: native error (native "SQL_ReadResult")
L 03/09/2008 - 00:04:49: [AMXX] [0] xtcs_userstats.sma::client_disconnect (line 110)
L 03/09/2008 - 00:15:34: Start of error session.
L 03/09/2008 - 00:15:34: Info (map "de_cpl_fire") (file "addons/amxmodx/logs/error_20080309.log")
L 03/09/2008 - 00:15:34: [MySQL] No result set in this query!
L 03/09/2008 - 00:15:34: [AMXX] Displaying debug trace (plugin "xtcs_userstats.amxx")
L 03/09/2008 - 00:15:34: [AMXX] Run time error 10: native error (native "SQL_ReadResult")
L 03/09/2008 - 00:15:34: [AMXX] [0] xtcs_userstats.sma::client_disconnect (line 110)
This is the part of the code:
Code:
public client_disconnect(id)
{
new clientname[32];
new szStats[8],szBHits[8];
new kills_map,deaths_map,headshots_map,teamkilling_map,shots_map,hits_map;
get_user_name(id,clientname,31);
get_user_rstats(id,szStats,szBHits);
// READ MAIN DATA
new Handle:QueryMain = SQL_PrepareQuery(SqlConnection, "SELECT `kills`,`deaths`,`headshots`,`teamkilling`,`shots`,`hits`,`eff`,`acc`,`skill` from xtcs_data WHERE csname = '%s'", clientname);
SQL_Execute(QueryMain);
kills = SQL_ReadResult(QueryMain,0);
deaths = SQL_ReadResult(QueryMain,1);
headshots = SQL_ReadResult(QueryMain,2);
teamkilling = SQL_ReadResult(QueryMain,3);
shots = SQL_ReadResult(QueryMain,4);
hits = SQL_ReadResult(QueryMain,5);
eff = SQL_ReadResult(QueryMain,6);
acc = SQL_ReadResult(QueryMain,7);
skill = SQL_ReadResult(QueryMain,8);
SQL_FreeHandle(QueryMain);
// READ MAP DATA
new Handle:QueryMap = SQL_PrepareQuery(SqlConnection, "SELECT `kills`,`deaths`,`headshots`,`teamkilling`,`shots`,`hits` from xtcs_data_map WHERE csname = '%s'", clientname);
SQL_Execute(QueryMap);
kills_map = SQL_ReadResult(QueryMap,0);
deaths_map = SQL_ReadResult(QueryMap,1);
headshots_map = SQL_ReadResult(QueryMap,2);
teamkilling_map = SQL_ReadResult(QueryMap,3);
shots_map = SQL_ReadResult(QueryMap,4);
hits_map = SQL_ReadResult(QueryMap,5);
SQL_FreeHandle(QueryMap);
...
}
Lines 99 and 100 are bold. What is so wrong in it?!
__________________