Код HTML:
stock LoadTurfs()
{
mysql_function_query(g_Handle, "SELECT * FROM `turfs`", true, "OnLoadTurfs", "");
}
Код HTML:
forward OnLoadTurfs();
public OnLoadTurfs()
{
new result[129], string[128];
cache_get_data(rows, fields);
if(!rows)
{
print(!"No turfs found!");
return true;
}
for(new i = 0; i != rows; i++)
{
cache_get_field_content(i, "ID", tInfo);
cache_get_field_content(i, "Owned", result), tInfo[i][tOwned] = strval(result);
cache_get_field_content(i, "Time", result), tInfo[i][tTime] = strval(result);
cache_get_field_content(i, "MinX", result), tInfo[i][tMinX] = floatstr(result);
cache_get_field_content(i, "MinY", result), tInfo[i][tMinY] = floatstr(result);
cache_get_field_content(i, "MaxX", result), tInfo[i][tMaxX] = floatstr(result);
cache_get_field_content(i, "MaxY", result), tInfo[i][tMaxY] = floatstr(result);
cache_get_field_content(i, "Nr", result), tInfo[i][tNr] = strval(result);
cache_get_field_content(i, "NrSize", result), tInfo[i][tNrSize] = strval(result);
}
return 1;
}