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

Quote:
Originally Posted by Emmet_
Посмотреть сообщение
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.
Thanks, that's much more efficient but, I'm afraid it's still not returning the string.. I'm continuing to work on it but having the same result.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)