Loading clans from DB
#3

Alright, Now I used it like this:
pawn Код:
forward LoadClans();
public LoadClans()
{
    new TempQuery[1028];
    for(new c = 1; c <= MAX_CLANS; c++)
    {
        mysql_format(MySQL, TempQuery, sizeof(TempQuery), "SELECT * FROM `"Clans_Table"` WHERE `cID` = '%i'", c);
        mysql_tquery(MySQL, TempQuery, "", "");

        new rows, fields;
        cache_get_data(rows, fields, MySQL);
        if(!rows) break;
        else if(rows)
        {
            cInfo[c][cID] = cache_get_field_content_int(0, "cID");
            cache_get_field_content(0, "cName", cInfo[c][cName], MySQL, 50);
            cache_get_field_content(0, "cOwner", cInfo[c][cOwner], MySQL, MAX_PLAYER_NAME);
            cache_get_field_content(0, "cOwner2", cInfo[c][cOwner2], MySQL, MAX_PLAYER_NAME);
            cInfo[c][cMembers] = cache_get_field_content_int(0, "cMembers");
            cInfo[c][cScore] = cache_get_field_content_int(0, "cScore");
        }
        ClansCreated++;
    }
    printf("[Bronze Stunting] Loaded %i clans.", ClansCreated);
    return 1;
}
And I had 1 clan in the database (testing)
It didn't load.

mysql_log
Код:
[21:22:31] [DEBUG] CMySQLConnection::Connect - establishing connection to database...
[21:22:31] [DEBUG] CMySQLConnection::Connect - connection was successful
[21:22:31] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
[21:22:31] [DEBUG] CMySQLConnection::Connect - connection was successful
[21:22:31] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
[21:22:31] [DEBUG] CMySQLConnection::Connect - connection was successful
[21:22:31] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
[21:22:31] [DEBUG] mysql_format - connection: 1, len: 1028, format: "SELECT * FROM `BSClans321` WHERE `cID` = '%i'"
[21:22:31] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `BSClans321` WHERE `cID` = '1'", callback: "(null)", format: "(null)"
[21:22:31] [DEBUG] cache_get_data - connection: 1
[21:22:31] [WARNING] cache_get_data - no active cache
[21:22:31] [DEBUG] mysql_errno - connection: 1
[21:22:31] [DEBUG] mysql_errno - connection: 1
[21:22:32] [DEBUG] CMySQLQuery::Execute[] - starting query execution
[21:22:32] [DEBUG] CMySQLQuery::Execute[] - query was successfully executed within 1.331 milliseconds
[21:22:32] [DEBUG] CMySQLQuery::Execute[] - no callback specified, skipping result saving
Reply


Messages In This Thread
Loading clans from DB - by biker122 - 25.07.2014, 14:13
Re: Loading clans from DB - by Virtual1ty - 25.07.2014, 15:08
Re: Loading clans from DB - by biker122 - 25.07.2014, 15:23
Re: Loading clans from DB - by AMouldyLemon - 25.07.2014, 15:25
Re: Loading clans from DB - by biker122 - 25.07.2014, 15:28
Re: Loading clans from DB - by AMouldyLemon - 25.07.2014, 15:29
Re: Loading clans from DB - by Konstantinos - 25.07.2014, 15:31
Re: Loading clans from DB - by biker122 - 25.07.2014, 15:39
Re: Loading clans from DB - by Konstantinos - 25.07.2014, 15:47
Re: Loading clans from DB - by Virtual1ty - 25.07.2014, 16:09

Forum Jump:


Users browsing this thread: 4 Guest(s)