SA-MP Forums Archive
MYSQL lag on update - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: MYSQL lag on update (/showthread.php?tid=412018)



MYSQL lag on update - omario - 31.01.2013

Hello,
My server has been lagging since yesterday, when i re-scripted my mysql account system
i found that the server stops working, when i update any field, for about 10sec

that's the updating stock which i use:

pawn Код:
stock MySQL_UpdateInt(const AccountName[], const FieldName[], IntValue)
{
    new query[512];
    format(query, sizeof(query), "UPDATE `accounts` SET `%s` = '%d' WHERE `Username` = '%s'", FieldName, intValue, Account);
    mysql_query(query);
    return 1;
}
Please tell me a way to solve this problem
sorry for bad english


Re: MYSQL lag on update - Vince - 31.01.2013

Where do you use this? Twenty times, In a MAX_PLAYER loop, that is on a timer, that runs every second?


Re: MYSQL lag on update - omario - 31.01.2013

i found the problem. it is that i use it on stock that saves all player variables, not the variable which i want to save