[MySQL] /f(action) bug | Reading a string from the SQL database
#6

Maybe you can try this:

pawn Код:
stock LoadFactionInfo(iFaction)
{
    new Query[700];
    format(Query, sizeof(Query), "SELECT * FROM `factioninfo` WHERE `factionid` = '%d'", iFaction);
    mysql_query(Query);
    mysql_store_result();
    if (mysql_num_rows())
    {
        mysql_fetch_row_format(Query, "|");
        sscanf(Query, "e<p<|><ds[32]ds[32]s[32]s[32]s[32]s[32]s[32]s[32]s[32]s[32]s[32]d>", FVar[iFaction]);
    }    
    mysql_free_result();
    return 1;
}

stock loadfactions()
{
    for(new i = 0; i != MAX_FACTIONS; i++)
    {
        LoadFactionInfo(i);
    }
    print("Factions loaded");
    return 1;
}
You stored a result one time and free'd a result like 10 times.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)