Well, meh function is like this:
Code:
public sqlx_test(id)
{
new authid[32]
get_user_authid(id,authid,31)
new Handle:Query = SQL_PrepareQuery(g_SqlConnection,"SELECT job FROM accounts WHERE steamid='%s'",authid);
SQL_Execute(Query)
if(!SQL_Execute(Query))
{
// if there were any problems
SQL_QueryError(Query,g_Error,511)
set_fail_state(g_Error)
}
StoreOther = SQL_ReadResult(Query, 0)
client_print(id,print_chat,"[SQLx Test] Found data : %d ",StoreOther)
SQL_FreeHandle(Query)
}
It says something like(Not sure but): [MySQL] No result from this query.
What's wrong with it?
Oh, and meh plugin_init is:
Code:
public plugin_init() {
// Registering
register_plugin("Items 2.0", "0.1b", "Rixorster")
// Console Commands
register_concmd("item_aidkit","item_aidkit")
register_concmd("item_emergencykit","item_emergencykit")
register_concmd("item_tazer","item_tazer")
register_concmd("item_lockpick","item_lockpick")
register_concmd("sqlx_test","sqlx_test")
// Client Commands
register_clcmd("say /trigger","Handle_Use")
register_clcmd("say /jail","Handle_Jail")
// Cvars
register_cvar("hrp_sql_host","127.0.0.1")
register_cvar("hrp_sql_user","root")
register_cvar("hrp_sql_pass","lollero")
register_cvar("hrp_sql_db","economy")
// SQLx
new host[64], user[64], pass[64], db[64], error[255];
get_cvar_string( "hrp_sql_host", host, 63 );
get_cvar_string( "hrp_sql_user", user, 63 );
get_cvar_string( "hrp_sql_pass", pass, 63 );
get_cvar_string( "hrp_sql_db", db, 63 );
g_SqlTuple = SQL_MakeDbTuple(host,user,pass,db);
new errorcode
g_SqlConnection=SQL_Connect(g_SqlTuple,errorcode,error,254);
if (!g_SqlConnection)
{
console_print(0,"[HRPi] Server cannot connect to database.")
console_print(0,"[HRPi] Error(%d): %s",errorcode,error)
return
}
console_print(0,"[HRPi] SQLx Connection Succesfull!")
}
__________________