I am getting some strange error with this function. I only get it when another plugin tries to use it. The debug trace points it to the line with result = dbi_query(dbc,query). So I put in a server_print as you can see and it returned this SELECT FROM ♦ WHERE steamid = ''. Something very strange is going on here.
Function Code -
Code:
public _testsqlint(table[],index[],authid[],equals[16],limit) {
new x
if(dbc < SQL_OK || limit > 15) return false
format(query,255,"SELECT %s FROM %s WHERE steamid = '%s'",index,table,authid)
server_print(query)
result = dbi_query(dbc,query)
if(dbi_nextrow(result) < 1) return false
x = dbi_field(result,1)
dbi_free_result(result)
for(new i=0;i < limit;i++) {
if(equals[i] == x) return true
}
format(query,255,"SELECT * FROM admins WHERE steamid = '%s' AND full_access = 1",authid)
result = dbi_query(dbc,query)
if(dbi_nextrow(result) > 0) {
dbi_free_result(result)
return true
}
dbi_free_result(result)
return false
}
Include Code -
Code:
// SQL Test Integer
native select_integer(table[],index[],authid[],equals[16],limit);
Plugin Code -
Code:
stuff[0] = 21
stuff[1] = 15
if(!select_integer("players","id",authid,stuff,2)) return PLUGIN_HANDLED
Error Message -
Code:
L 12/10/2006 - 16:06:01: [MySQL] Invalid DBI result handle -1
L 12/10/2006 - 16:06:01: [AMXX] Displaying debug trace (plugin "GabionKernel.amxx")
L 12/10/2006 - 16:06:01: [AMXX] Run time error 10: native error (native "dbi_nextrow")
L 12/10/2006 - 16:06:01: [AMXX] [0] GabionKernel.sma::_testsqlint (line 296)
L 12/10/2006 - 16:06:01: Unhandled dynamic native error
L 12/10/2006 - 16:06:01: [AMXX] Displaying debug trace (plugin "explode.amxx")
L 12/10/2006 - 16:06:01: [AMXX] Run time error 10: native error (native "select_integer")
L 12/10/2006 - 16:06:01: [AMXX] [0] explode.sma::exploded (line 36)