Thanks for the replies.
@Minimum:
I'm trying to use the threaded query not the prepare query. Threaded queries are better to use right?
Also I think I might be on to something but it doesn't seem to be working...
SQL_ThreadQuery ( Handle:cn_tuple, const handler[], const query[],
const data[]=0 )
That data should be sent to the handler...
public QueryHandler(failstate, Handle:query, error[], errnum,
data[], size)
Here is an example that doesn't return the data I sent.
PHP Code:
public function()
{
new authid[33];
get_user_authid(id, authid, 32);
format(g_Cache, 511, "SELECT * FROM players WHERE steamid='%s'", authid);
SQL_ThreadQuery(g_SqlTuple, "SelectHandle", g_Cache, "Test");
return FMRES_HANDLED;
}
public SelectHandle(FailState, Handle:Query, Error[], Errcode, Data[], DataSize)
{
if(FailState == TQUERY_CONNECT_FAILED)
return set_fail_state("Could not connect to SQL database.");
else if(FailState == TQUERY_QUERY_FAILED)
return set_fail_state("Query failed.");
if(Errcode)
return log_amx("Error on query: %s", Error);
// Shouldn't this display "Test" because it's the data that was sent?
// Instead it displays a blank line.
client_print(0, print_chat, "%s", Data);
return PLUGIN_CONTINUE;
}