What do you want to hash with the results, name exists in the db or not?
iīm not really expired with dbi, but try:
PHP Code:
public login(name[],pass[])
{
new hash[34]
md5(pass,hash)
{
new Result:result = dbi_query(gMySQL,"SELECT * FROM %s WHERE name like '%s' and pass like BINARY '%s'", USER_TABLE, name, hash)
if(result <= RESULT_NONE)
{
dbi_free_result(result)
return 1
}
result = dbi_query(gMySQL,"SELECT * FROM %s WHERE name like '%s' and pass like BINARY '%s'", WAITING_TABLE, name, hash)
if(result <= RESULT_NONE)
{
dbi_free_result(result)
return -2
}
}
return -1
}
also what i always do: open sql_init() from plugin_cfg() with a little delay (like 0.5)
PHP Code:
public plugin_cfg()
{
set_task(0.5,"sql_init")
}
public sql_init()
{
...
so you can make sure all cvars loaded
__________________