PHP код:
funktsioon LoadProperty()
{
new
result[128], idx, sql[256];
for(new i = 1; i <= kokkuMaju; i++)
{
format(sql, sizeof(sql), "SELECT * FROM `majad` WHERE `id` = '%d'", i);
mysql_query(sql);
mysql_store_result();
if(mysql_fetch_row_format(sql,"|"))
{
mysql_fetch_field_row(result,"Owned"); KasutajaMajaInfo[i][hOwned] = strval(result);
mysql_fetch_field_row(result,"Owner"); KasutajaMajaInfo[i][hOwner] = strval(result);
mysql_fetch_field_row(result,"Description"); strmid(KasutajaMajaInfo[i][hDescription], result, 0, strlen(result), 255);//
mysql_fetch_field_row(result,"Value"); KasutajaMajaInfo[i][hValue] = strval(result);
mysql_fetch_field_row(result,"Level"); KasutajaMajaInfo[i][hLevel] = strval(result);
mysql_fetch_field_row(result,"Locked"); KasutajaMajaInfo[i][hLocked] = strval(result);
mysql_fetch_field_row(result,"LeaseDate"); KasutajaMajaInfo[i][hLeaseDate] = strval(result);
mysql_fetch_field_row(result,"EntranceX"); KasutajaMajaInfo[i][hEntranceX] = floatstr(result);
mysql_fetch_field_row(result,"EntranceY"); KasutajaMajaInfo[i][hEntranceY] = floatstr(result);
mysql_fetch_field_row(result,"EntranceZ"); KasutajaMajaInfo[i][hEntranceZ] = floatstr(result);
mysql_fetch_field_row(result,"InteriorX"); KasutajaMajaInfo[i][hInteriorX] = floatstr(result);
mysql_fetch_field_row(result,"InteriorY"); KasutajaMajaInfo[i][hInteriorY] = floatstr(result);
mysql_fetch_field_row(result,"InteriorZ"); KasutajaMajaInfo[i][hInteriorZ] = floatstr(result);
mysql_fetch_field_row(result,"InteriorId"); KasutajaMajaInfo[i][hInterior] = strval(result);
mysql_fetch_field_row(result,"HealthUpgrade"); KasutajaMajaInfo[i][hHealthUpgrade] = strval(result);
mysql_fetch_field_row(result,"ArmourUpgrade"); KasutajaMajaInfo[i][hKappUpgrade] = strval(result);
mysql_fetch_field_row(result,"RentAble"); KasutajaMajaInfo[i][hRentable] = strval(result);
mysql_fetch_field_row(result,"Rent"); KasutajaMajaInfo[i][hRent] = strval(result);
mysql_fetch_field_row(result,"Bank"); KasutajaMajaInfo[i][hBank] = strval(result);
mysql_fetch_field_row(result,"Narko"); KasutajaMajaInfo[i][hProds] = strval(result);
mysql_fetch_field_row(result,"Mats1"); KasutajaMajaInfo[i][hMats][0] = strval(result);
mysql_fetch_field_row(result,"Mats2"); KasutajaMajaInfo[i][hMats][1] = strval(result);
mysql_fetch_field_row(result,"Mats3"); KasutajaMajaInfo[i][hMats][2] = strval(result);
mysql_fetch_field_row(result,"Address"); strmid(KasutajaMajaInfo[i][hAddress], result, 0, strlen(result), 64);
idx++;
}
mysql_free_result();
}
printf("[MySQL] Loaded %d houses.", idx);
}
.
That will improve your current code. You can make it loading much faster by updating the mysql plugin to R38 and using threaded queries.
You can't make it load fast. You're using the unthreaded queries which sucks hard, and they're freaking slow as compared to threaded queries. Search for cache tutorials for BlueG's MySQL plugin R7+ (the latest release is R38 now).
Yeah, I thought about the renewal but it is quite difficult and also specific skill is not.