I have a function that checks if a clan name exists in the database, and also returns the id of that clan... The query works fine. but dbi_result only returns null even if there's a result returned by dbi_query...
What could be the problem?
Code:
g_result = dbi_query(g_dbc,"SELECT id FROM clans WHERE name = '%s' LIMIT 1", clanCT)
if (dbi_num_rows(g_result) < 1)
{
console_print(id,"* Clan '%s' does not exist in database!", clanCT)
dberror = 1
}
else
{
dbi_nextrow(g_result)
dbi_result(g_result, "id", team_one_id)
}
dbi_free_result(g_result)
Thanks!