No need to check that, since there isn't any sql handle used...
line 393:
PHP Code:
SQL_QuoteString(Empty_Handle,dest,len,server_name)
You can't pass Empty_Handle as a first argument to that function, you must use sql connection handle.
PHP Code:
//1. Define handles
new Handle:g_sql_tuple
new Handle:g_sql_connection
//2. MakeDbTuple and SQL_Connect
public sql_init(){
new host[32], user[32], pass[32], db[32]
//get host, user, pass, db ...
g_sql_tuple = SQL_MakeDbTuple(host, user, pass, db)
new err[512], err_code
g_sql_connection = SQL_Connect(g_sql_tuple,err_code,err,511)
if(g_sql_connection == Empty_Handle){
log_amx("SQL Error: %s (%d)", err, err_code)
//SQL_Connect failed, so we can't use g_sql_connection handle
}
}
//3. Use handle in SQL_QuoteString (you must use g_sql_connection, not g_sql_tuple)
SQL_QuoteString(g_sql_connection, dest, len, source)
//4. Free sql connection handle in plugin_end
public plugin_end(){
if(g_sql_connection != Empty_Handle)
SQL_FreeHandle(g_sql_connection)
}
__________________