23.07.2011, 08:23
Just put _ there.
Код:
mysql_format(_,.....);
mysql_format(_,.....);
[12:47:15] The server has been crashed by mysql_ping at line 15181 in rr.pwn.
[12:47:15] Stack trace of gamemodes\rr.amx (most recent call first):
[12:47:16] #0: (null) (entry point) in rr.pwn
[18:41:43] CMySQLHandler::Query(SELECT `job` FROM `jobs` WHERE `name` = "Noah_Vosen") - Successfully executed. [18:41:43] >> mysql_store_result( Connection handle: 1 ) [18:41:43] CMySQLHandler::StoreResult() - Result was stored. [18:41:43] >> mysql_num_rows( Connection handle: 1 ) [18:41:43] CMySQLHandler::NumRows() - Returned 1 row(s) [18:41:43] >> mysql_fetch_int( Connection handle: 1 ) [18:41:43] CMySQLHandler::FetchRow() - Return: 0 [18:41:43] >> mysql_free_result( Connection handle: 1 ) [18:41:43] CMySQLHandler::FreeResult() - Result was successfully free'd. [18:41:43] >> mysql_reconnect( Connection handle: 1 ) [18:41:43] CMySQLHandler::Disconnect() - Connection was closed. [18:41:43] CMySQLHandler::Connect() - Can't connect to MySQL server on '91.82.84.98' (10048) (Error ID: 2003) [18:41:44] >> mysql_format( Connection handle: 1 ) [18:41:44] >> mysql_query( Connection handle: 1 ) [18:41:44] CMySQLHandler::Query() - You cannot call this function now. (Reason: Connection is dead) [18:41:44] >> mysql_store_result( Connection handle: 1 ) [18:41:44] CMySQLHandler::StoreResult() - There is nothing to store (Reason: Connection is dead) [18:41:44] >> mysql_num_rows( Connection handle: 1 ) [18:41:44] CMySQLHandler::NumRows() - You cannot call this function now. (Reason: Dead Connection) [18:41:44] >> mysql_fetch_int( Connection handle: 1 ) [18:41:44] CMySQLHandler::FetchRow() - You cannot call this function now. (Reason: Connection is dead) [18:41:44] >> mysql_free_result( Connection handle: 1 ) [18:41:44] CMySQLHandler::FreeResult() - There is nothing to free (Reason: Connection is dead) [18:41:44] >> mysql_reconnect( Connection handle: 1 ) [18:41:44] CMySQLHandler::Disconnect() - You cannot call this function now. (Reason: Connection is dead) [18:41:44] CMySQLHandler::Connect() - Connection was successful. [18:41:44] CMySQLHandler::Connect() - Auto-Reconnect has been enabled. [18:41:45] >> mysql_reconnect( Connection handle: 1 ) [18:41:45] CMySQLHandler::Disconnect() - Connection was closed. [18:41:45] CMySQLHandler::Connect() - Connection was successful.
[22:45:54] CMySQLHandler::Query(SELECT `user_id` FROM `users` WHERE `name` = 'Maximilien_Maurizio') - Successfully executed. [22:45:54] >> mysql_store_result( Connection handle: 1 ) [22:45:54] CMySQLHandler::StoreResult() - Result was stored. [22:45:54] >> mysql_num_rows( Connection handle: 1 ) [22:45:54] CMySQLHandler::NumRows() - Returned 1 row(s) [22:45:54] >> mysql_free_result( Connection handle: 1 ) [22:45:54] CMySQLHandler::FreeResult() - Result was successfully free'd. [22:45:54] >> mysql_format( Connection handle: 1 ) [22:45:54] >> mysql_query( Connection handle: 1 ) [22:45:54] CMySQLHandler::Query(UPDATE `users` SET `heal` = 42.527000, `x` = 251.001358,`y` = -158.046692,`z` = 1.570322,`a` = 106.713684,`interior` = 0, `vw` = 0, time = time+39 WHERE `name` = "Maximilien_Maurizio") - Successfully executed. [22:59:58] >> mysql_free_result( Connection handle: 1 ) [22:59:58] CMySQLHandler::FreeResult() - The result is already empty. [22:59:58] >> mysql_query( Connection handle: 1 ) [22:59:58] CMySQLHandler::Query(SELECT * FROM `banlist` WHERE `banned` = "Vittorio_Benedetto") - An error has occured. (Error ID: 2006, MySQL server has gone away) [22:59:58] >> mysql_store_result( Connection handle: 1 ) [22:59:58] CMySQLHandler::StoreResult() - No data to store. [22:59:58] >> mysql_num_rows( Connection handle: 1 ) [22:59:58] CMySQLHandler::NumRows() - You cannot call this function now. (Reason: Dead Connection) [22:59:58] >> mysql_free_result( Connection handle: 1 ) [22:59:58] CMySQLHandler::FreeResult() - The result is already empty. [22:59:58] >> mysql_query( Connection handle: 1 ) [22:59:58] CMySQLHandler::Query(SELECT * FROM `banlist` WHERE `banned` = "Vittorio_Benedetto") - An error has occured. (Error ID: 2006, MySQL server has gone away) [22:59:58] >> mysql_store_result( Connection handle: 1 ) [22:59:58] CMySQLHandler::StoreResult() - No data to store. [22:59:58] >> mysql_fetch_row_format( Connection handle: 1 ) [22:59:58] CMySQLHandler::FetchRow() - You cannot call this function now. (Reason: Empty Result)
public OnQueryError(errorid, error[], resultid, extraid, callback[], query[], connectionHandle) { switch(errorid) { case CR_SERVER_LOST: { print("[MYSQL-DEATH]"); mysql_reconnect(); } } }
[17:16:59] CMySQLHandler::Query(UPDATE vehicles SET gas=34.9,km=13.590893,health=1000.0,engine=0,lights=1,doors=-1,boot=-1 WHERE carid = 877) - Successfully executed. [17:16:59] >> mysql_format( Connection handle: 1 ) [17:16:59] >> mysql_query( Connection handle: 1 ) [17:16:59] CMySQLHandler::Query(SELECT `job` FROM `jobs` WHERE `name` = "Sylar_Fukuda") - Successfully executed. [17:16:59] >> mysql_free_result( Connection handle: 1 ) [17:16:59] CMySQLHandler::FreeResult() - Result was successfully free'd. [17:16:59] >> mysql_store_result( Connection handle: 1 ) [17:16:59] CMySQLHandler::StoreResult() - Result was stored. [17:16:59] >> mysql_num_rows( Connection handle: 1 ) [17:16:59] CMySQLHandler::NumRows() - Returned 0 row(s) [17:17:01] >> mysql_query( Connection handle: 1 ) [17:17:01] CMySQLHandler::Query(UPDATE vehicles SET gas=34.9,km=13.590893,health=1000.0,engine=1,lights=1,doors=-1,boot=-1 WHERE carid = 877) - An error has occured. (Error ID: 2006, MySQL server has gone away) [17:17:01] OnQueryError() - Called. [17:17:01] >> mysql_reconnect( Connection handle: 1 ) [17:17:01] CMySQLHandler::Disconnect() - Connection was closed. [17:17:02] CMySQLHandler::Connect() - Can't connect to MySQL server on '91.82.84.98' (10061) (Error ID: 2003) [17:17:05] >> mysql_query( Connection handle: 1 ) [17:17:05] CMySQLHandler::Query() - You cannot call this function now. (Reason: Connection is dead) [17:17:05] >> mysql_format( Connection handle: 1 ) [17:17:05] >> mysql_query( Connection handle: 1 ) [17:17:05] CMySQLHandler::Query() - You cannot call this function now. (Reason: Connection is dead) [17:17:05] >> mysql_free_result( Connection handle: 1 ) [17:17:05] CMySQLHandler::FreeResult() - There is nothing to free (Reason: Connection is dead) [17:17:05] >> mysql_store_result( Connection handle: 1 ) [17:17:05] CMySQLHandler::StoreResult() - There is nothing to store (Reason: Connection is dead) [17:17:05] >> mysql_num_rows( Connection handle: 1 ) [17:17:05] CMySQLHandler::NumRows() - You cannot call this function now. (Reason: Dead Connection) [17:17:05] >> mysql_fetch_int( Connection handle: 1 ) [17:17:05] CMySQLHandler::FetchRow() - You cannot call this function now. (Reason: Connection is dead) [17:17:05] >> mysql_free_result( Connection handle: 1 ) [17:17:05] CMySQLHandler::FreeResult() - There is nothing to free (Reason: Connection is dead) [17:17:07] >> mysql_format( Connection handle: 1 ) [17:17:07] >> mysql_query( Connection handle: 1 ) [17:17:07] CMySQLHandler::Query() - You cannot call this function now. (Reason: Connection is dead)
Instead of making an argument, you could simply point out how. You will get an error about the argument not having a default value, unless you add extra code or make any other modifications in the script.
|
mysql_format(_, query, "SELECT * FROM `users` WHERE `username` = '%s' AND `password` = '%e';", playername, password);
Is it just me or are negatives not handled correctly using mysql_format and %d/%i?
pawn Код:
Код:
Positive: 1, Negative: Might be just me, but anyone else getting this? I'm on Windows 7 x64. |