23.08.2018, 22:06
PHP код:
[23:54:31] [ERROR] mysql_format: invalid connection handle '0'
[23:54:31] [ERROR] mysql_query: invalid connection handle '0'
[23:54:31] [ERROR] cache_get_row_count: no active cache
[23:54:31] [WARNING] mysql_connect: no password specified
PHP код:
enum ClanData
{
ClanID,
ClanName[32],
ClanColor[32],
Float:ClanSpawn[32],
Leader[32],
Official,
Rank1,
Rank2,
Rank3,
Rank4,
Rank5
};
new ClanInfo[MAX_CLANS][ClanData];
PHP код:
forward LoadClans();
public LoadClans()
{
new query[1500];
new rows;
mysql_format(Database, query, sizeof(query), "SELECT * FROM `clans`");
new Cache:result = mysql_query(Database, query);
cache_get_row_count(rows);
if(!rows)
{
printf("[SERVER]: No clans were loaded from the MYSQL Database.");
return 0;
}
for (new i = 0; i < rows; i ++)
{
cache_get_value_name_int(i, "ClanID", ClanInfo[i][ClanID]);
cache_get_value_name(i, "ClanName", ClanInfo[i][ClanName]);
cache_get_value_name(i, "ClanColor", ClanInfo[i][ClanColor]);
cache_get_value_name_float(i, "ClanSpawn", ClanInfo[i][ClanSpawn]);
cache_get_value_name(i, "Leader", ClanInfo[i][Leader]);
cache_get_value_name(i, "Official", ClanInfo[i][Official]);
cache_get_value_name_int(i, "Rank1", ClanInfo[i][Rank1]);
cache_get_value_name_int(i, "Rank2", ClanInfo[i][Rank2]);
cache_get_value_name_int(i, "Rank3", ClanInfo[i][Rank3]);
cache_get_value_name_int(i, "Rank4", ClanInfo[i][Rank4]);
cache_get_value_name_int(i, "Rank5", ClanInfo[i][Rank5]);
}
cache_delete(result);
printf("[SERVER] %d clans were loaded from the MYSQL Database", rows);
return 1;
}