Loading clans from DB
#1

So, I started working on a new project with around 4 members..
I got struck up in loading the clans from the database [MySQL R-38]

pawn Код:
forward LoadClans();
public LoadClans()
{
    for(new c = 1; c <= MAX_CLANS; c++)
    {
        mysql_format(MySQL, gQuery, 256, "SELECT * FROM `"Clans_Table"` WHERE `cID` = '%i'", c);
        mysql_tquery(MySQL, gQuery, "", "");

        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;
}
So, There's already a clan with ID 1 in the database, but it doesn't load it. ;o
Can someone help me in solving this?
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: 1 Guest(s)