Signature
stock Handle:SQL_MakeStdTuple(timeout = 0){ static host[64], user[32], pass[32], db[128]; static get_type[12], set_type[12]; get_cvar_string("amx_sql_host", host, 63); get_cvar_string("amx_sql_user", user, 31); get_cvar_string("amx_sql_pass", pass, 31); get_cvar_string("amx_sql_type", set_type, 11); get_cvar_string("amx_sql_db", db, 127); if(timeout <= 0) { timeout = get_cvar_num("amx_sql_timeout"); } SQL_GetAffinity(get_type, 12); if(!equali(get_type, set_type)) { if(!SQL_SetAffinity(set_type)) { log_amx("Failed to set affinity from %s to %s.", get_type, set_type); } } return SQL_MakeDbTuple(host, user, pass, db, timeout);}
Description
Use this for making a standard DB Tuple, using AMXX's database info cvars.
Parameters
-
timeout
—
Specifies how long connections should wait before giving up.
If 0, the value is read from "amx_sql_timeout" cvar.
Returns
A newly created tuple handle to be used in connection routines.