25.07.2014, 14:13
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]
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?
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;
}
Can someone help me in solving this?