MYSQL Question
#1

Hi guys, i changed my Y_INI gm to mysql, because my y_ini files stared to bug, not loading, not saving etc...

so i made this for loading stats:
Код:
LoadPStat(playerid, "level", PlayerInfo[playerid][pLevel]);
and i have about 150 lines like that, to load all stats

and here is that callback:
Код:
forward LoadPStat(playerid, what[], &sta);
public LoadPStat(playerid, what[], &sta) {
	new tmp[130];
    cache_get_field_content(0, what, tmp);
	sta = strval(tmp);
	return 1;
}
and here is query to call a load...
Код:
mysql_format(MySQL, Query, sizeof(Query), "SELECT * FROM `korisnici` WHERE `ime` = '%s'", GetName(playerid));
				mysql_function_query(MySQL, Query, true, "UcitajIgraca", "i", playerid);
and this is just too slow, is there another way to speed it up or its just the host mysql too slow?
Reply
#2

Bumpy, i know it was not passed 24h but im in hurry...
Reply
#3

Probably a host problem mate. MySQL is fast, but it requires a fast server to be fast.
Reply
#4

Quote:
Originally Posted by sammp
Посмотреть сообщение
Probably a host problem mate. MySQL is fast, but it requires a fast server to be fast.
Aham thanks bro, rep+, so my code is just fine?
Reply
#5

Yeah...
Reply
#6

Quote:
Originally Posted by Dusan01
Посмотреть сообщение
and i have about 150 lines like that, to load all stats
*Sigh*. Sorry. This is a pet peeve of mine. Don't put so much stuff in a single table, and only load the stuff you require at the moment. I never understood the practice of copying every single bit (no pun intended) of data into memory. Only load the stuff that is immediately visible on the screen. Stuff that is invisible until the player specifically requests it should not be loaded but instead fetched directly from the database as and when it's needed.
Reply
#7

Quote:
Originally Posted by Vince
Посмотреть сообщение
*Sigh*. Sorry. This is a pet peeve of mine. Don't put so much stuff in a single table, and only load the stuff you require at the moment. I never understood the practice of copying every single bit (no pun intended) of data into memory. Only load the stuff that is immediately visible on the screen. Stuff that is invisible until the player specifically requests it should not be loaded but instead fetched directly from the database as and when it's needed.
Ahh, i know that now, but when i was creating this script from 0 i did not know that, so its 0% optimized... im trying to fix all of that now, thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)