06.01.2014, 12:16
I have a shitton of houses on my RP MySQL-based server. This is how I load them when the server is starting up:
Then:
LoadHouse function is basically querying
For every house.
And then I use
for every data related to the house storing it in the memory.
Is there anyway to make much less queries so I can load the server MUCH faster? I'm not a MySQL expert so I have no idea how to.
PHP код:
mysql_query("SELECT `ID` FROM `houses`");
mysql_store_result();
new id[128], housearray[MAX_HOUSES], bizzarray[MAX_BIZZES], ch=0, cb=0;
while(mysql_fetch_row_format(id)) {
housearray[ch] = strval(id);
ch++;
}
mysql_free_result();
PHP код:
for(new c = 0; c<ch; c++) LoadHouse(housearray[c]);
PHP код:
SELECT * FROM `houses` WHERE `ID` = '%d'
And then I use
PHP код:
mysql_fetch_field_row(temp, "ID"), hInfo[house_num][ID] = strval(temp);
Is there anyway to make much less queries so I can load the server MUCH faster? I'm not a MySQL expert so I have no idea how to.