15.04.2016, 19:59
Quote:
Do you still use this:
PHP код:
PHP код:
For the second, this should be loaded within one second as you only send 1 query instead of 662 queries. The query already loads ALL houses from the table at once, there is no need to loop through each house separately and send a query for each house. |
Like:
Код:
mysql_tquery(server, "SELECT * FROM houses", "LoadHouses");
Код:
forward LoadHouses(); public LoadHouses() { new time = GetTickCount(); for(new b; b != 660; ++b) { House[b][hID] = cache_get_row_int(b, 0); House[b][hEnterX] = cache_get_row_float(b, 1); House[b][hEnterY] = cache_get_row_float(b, 2); House[b][hEnterZ] = cache_get_row_float(b, 3); House[b][hExitX] = cache_get_row_float(b, 4); House[b][hExitY] = cache_get_row_float(b, 5); House[b][hExitZ] = cache_get_row_float(b, 6); House[b][hCarX] = cache_get_row_float(b, 7); House[b][hCarY] = cache_get_row_float(b, 8); House[b][hCarZ] = cache_get_row_float(b, 9); House[b][hCarC] = cache_get_row_float(b, 10); cache_get_row(b, 11, House[b][hOwner]); House[b][hCost] = cache_get_row_int(b, 12); House[b][hInt] = cache_get_row_int(b, 13); House[b][hVW] = cache_get_row_int(b, 14); House[b][hLock] = cache_get_row_int(b, 15); } printf("%d ms",GetTickCount()-time); }]