27.06.2013, 17:49
Thank you.
format(string, sizeof(string), "SELECT * FROM `hesaplar` WHERE `isim` = '%s'", GetPlayerNameEx(playerid)); mysql_query(string); mysql_store_result();
public OyuncuKaydetInt(playerid, sutun[], deger) { new string[128]; format(string, sizeof(string), "UPDATE `hesaplar` SET `%s` = '%d' WHERE `isim` = '%s'", sutun, deger, GetPlayerNameEx(playerid)); mysql_query(string); }
I've never seen the point of using mysql_close ... try without it.
|
Hm, I couldn't reproduce your crash with sending the "exit" command, but I caused another crash under unnormal circumstances where I called "mysql_close" directly after calling all "mysql_function_query" functions and then fetching the result after the connection was closed. Maybe you are doing this?
|
Could you create a small gamemode where you execute 10-20 queries, wait a bit and then close the server with the "exit" command and also calling mysql_close in OnGameModeExit? I don't know if this is a problem with the plugin, your gamemode or your MySQL server.
EDIT: Are you using Linux or Windows? |
public OnGameModeInit()
{
new connection = mysql_connect("localhost", "root", "server", "");
mysql_function_query(connection, "INSERT INTO `testing` (testingcol1, testingcol2) VALUES(1, 2)", false, "", "");
mysql_function_query(connection, "INSERT INTO `testing` (testingcol1, testingcol2) VALUES(3, 4)", false, "", "");
mysql_function_query(connection, "INSERT INTO `testing` (testingcol1, testingcol2) VALUES(5, 6)", false, "", "");
mysql_function_query(connection, "INSERT INTO `testing` (testingcol1, testingcol2) VALUES(7, 8)", false, "", "");
mysql_function_query(connection, "INSERT INTO `testing` (testingcol1, testingcol2) VALUES(9, 10)", false, "", "");
mysql_function_query(connection, "UPDATE `testing` SET `testingcol1` = 1, `testingcol2` = 2 WHERE test = 1", false, "", "");
mysql_function_query(connection, "UPDATE `testing` SET `testingcol1` = 1, `testingcol2` = 2 WHERE test = 3", false, "", "");
mysql_function_query(connection, "UPDATE `testing` SET `testingcol1` = 1, `testingcol2` = 2 WHERE test = 5", false, "", "");
mysql_function_query(connection, "DELETE FROM `testing` WHERE test = 2", false, "", "");
mysql_function_query(connection, "DELETE FROM `testing` WHERE test = 4", false, "", "");
mysql_function_query(connection, "INSERT INTO `testing` (testingcol1, testingcol2) VALUES(456, 78945)", false, "", "");
mysql_function_query(connection, "INSERT INTO `testing` (testingcol1, testingcol2) VALUES(687, 456489)", false, "", "");
mysql_function_query(connection, "INSERT INTO `testing` (testingcol1, testingcol2) VALUES(6387, 657)", false, "", "");
mysql_function_query(connection, "DELETE FROM `testing` WHERE testingcol1 > 750", false, "", "");
mysql_function_query(connection, "DELETE FROM `testing` WHERE testingcol2 < 450", false, "", "");
mysql_function_query(connection, "INSERT INTO `testing` (testingcol1, testingcol2) VALUES(5, 6)", false, "", "");
mysql_function_query(connection, "INSERT INTO `testing` (testingcol1, testingcol2) VALUES(7, 8)", false, "", "");
mysql_function_query(connection, "INSERT INTO `testing` (testingcol1, testingcol2) VALUES(9, 10)", false, "", "");
SetGameModeText("Blank Script");
return 1;
}
Console input: exit [19:37:12] --- Server Shutting Down. [19:37:12] NF 0 [19:37:12] NF 1 [19:37:12] NF 2 [19:37:12] NF 3 [19:37:12] NF 4 [19:37:12] plugin.mysql: Unloading plugin... [19:37:12] [debug] Server crashed due to an unknown error [19:37:12] [debug] Native backtrace: [19:37:12] [debug] #0 71cda891 in ?? () from C:\Users\Administrator\Server\plugins\mysql.DLL [19:37:12] [debug] #1 71cc36d0 in ?? () from C:\Users\Administrator\Server\plugins\mysql.DLL [19:37:12] [debug] #2 71cd1093 in ?? () from C:\Users\Administrator\Server\plugins\mysql.DLL [19:37:12] [debug] #3 004693bb in ?? () from C:\Users\Administrator\Server\samp-server.exe [19:37:12] [debug] #4 00488b66 in ?? () from C:\Users\Administrator\Server\samp-server.exe |