pawn Код:
stock InitFactions()
{
mysql_function_query(connectionHandle, "SELECT * FROM `Factions`", true, "LoadFactionsCallback", "d", id); // Select all data in Factions table
}
forward LoadFactionsCallback(); public LoadFactionsCallback()
{
new
rows,
fields;
cache_get_data(rows, fields); // Get mysql data rows
if(rows == 0) return print("Error -> empty database!");
if(rows > MAX_FACTIONS) return print("Error -> too many data row!");
for(new id; id < MAX_FACTIONS; id++)
{
blabla[id][FactionID] = cache_get_row_int(id, 0);
blabla[id][bla2] = cache_get_row_int(id, 1);
blabla[id][bla3] = cache_get_row_float(id, 2);
blabla[id][bla4] = cache_get_row_float(id, 3);
}
return 0;
}