The Code seems ok to me, enable MySQL logging by putting 'mysql_log(LOG_ALL);' in OnGameModeInit before you connect to the db then try running the query and check MySQL log file in server directory it will show you what is the error. Make sure that the MySQL server is up and running.
Код:
[14:56:52] [DEBUG] mysql_connect - host: "localhost", user: "root", database: "server_database", password: "****", port: 3306, autoreconnect: true
[14:56:52] [DEBUG] CMySQLHandle::Create - creating new connection..
[14:56:52] [DEBUG] CMySQLHandle::CMySQLHandle - constructor called
[14:56:52] [DEBUG] CMySQLHandle::Create - connection created with ID = 1
[14:56:52] [DEBUG] CMySQLConnection::Connect - connection was successful
[14:56:52] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
[14:56:52] [DEBUG] CMySQLConnection::Connect - connection was successful
[14:56:52] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
[14:56:52] [DEBUG] mysql_errno - connection: 1
[14:57:17] [DEBUG] mysql_format - connection: 1, len: 128, format: "SELECT `pPassword`, `pID` FROM `playeraccounts` WHERE `Username` = '%e' LIMIT 1"
[14:57:17] [DEBUG] mysql_tquery - connection: 1, query: "SELECT `pPassword`, `pID` FROM `playeraccounts` WHERE `Username`", callback: "OnAccountCheck", format: "i"
[14:57:17] [DEBUG] CMySQLQuery::CMySQLQuery() - constructor called
[14:57:17] [DEBUG] mysql_tquery - scheduling query "SELECT `pPassword`, `pID` FROM `playeraccounts` WHERE `Username` = 'Daves' LIMIT 1"..
[14:57:17] [DEBUG] CMySQLQuery::Execute[OnAccountCheck(i)] - starting query execution
[14:57:17] [DEBUG] CMySQLQuery::Execute[OnAccountCheck(i)] - query was successful
[14:57:17] [DEBUG] CMySQLResult::CMySQLResult() - constructor called
[14:57:17] [DEBUG] CMySQLQuery::Execute[OnAccountCheck(i)] - data being passed to ProcessCallbacks()
[14:57:17] [DEBUG] Calling callback "OnAccountCheck"..
[14:57:17] [DEBUG] cache_get_data - connection: 1
[14:57:17] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called
[14:57:17] [DEBUG] CMySQLQuery::~CMySQLQuery() - deconstructor called
[14:57:19] [DEBUG] mysql_format - connection: 1, len: 1000, format: ""INSERT INTO `playeraccounts` (`Username`, `pPassword`, `pCash`, `pMoney`, `pAdmin`, `pKills`, `pTeamFaction`, `pStaff`,`pSaveSk..."
[14:57:19] [DEBUG] mysql_tquery - connection: 1, query: ""INSERT INTO `playeraccounts` (`Username`, `pPassword`, `pCash`,", callback: "OnRegistered", format: "i"
[14:57:19] [DEBUG] CMySQLQuery::CMySQLQuery() - constructor called
[14:57:19] [DEBUG] mysql_tquery - scheduling query ""INSERT INTO `playeraccounts` (`Username`, `pPassword`, `pCash`, `pMoney`, `pAdmin`, `pKills`, `pTeamFaction`, `pStaff`,`pSaveSkin`, `pSelected`, `pCharater`, `pLoggedIn`, `pSpy`, `pFbi`, `pFaction`, `pQuit`,`pDeathRP`, `pSpawnPosX`, `pSpawnPosY`, `pSpawnPosZ`, `pSpawnSaved`, `pArmour`,`pHostAddress`, `pLastPlayed`, `pIP`, `pAmmo1`, `pAmmo2`, `pSpyRank`) VALUES ('Daves', '12345', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'None', 0, '127.0.0.1', 0, 0, 'None')""..
[14:57:19] [DEBUG] CMySQLQuery::Execute[OnRegistered(i)] - starting query execution
[14:57:19] [ERROR] CMySQLQuery::Execute[OnRegistered(i)] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"INSERT INTO `playeraccounts` (`Username`, `pPassword`, `pCash`, `pMoney`, `pAdm' at line 1
[14:57:19] [DEBUG] CMySQLQuery::Execute[OnRegistered(i)] - error will be triggered in OnQueryError
[14:57:19] [DEBUG] CMySQLQuery::Execute[OnRegistered(i)] - data being passed to ProcessCallbacks()
[14:57:19] [DEBUG] Calling callback "OnQueryError"..
[14:57:19] [DEBUG] CMySQLQuery::~CMySQLQuery() - deconstructor called
[14:57:22] [DEBUG] mysql_format - connection: 1, len: 1000, format: "UPDATE `playeraccounts` SET `pPassword`, `pIP`, `pAdmin`, `pKills`, `pMoney`,`pCash` ,`pTeamFaction`, `pStaff`, `pSaveSkin`, `pS..."
[14:57:22] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE `playeraccounts` SET `pPassword`, `pIP`, `pAdmin`, `pKill", callback: "(null)", format: "(null)"
[14:57:22] [DEBUG] CMySQLQuery::CMySQLQuery() - constructor called
[14:57:22] [DEBUG] mysql_tquery - scheduling query "UPDATE `playeraccounts` SET `pPassword`, `pIP`, `pAdmin`, `pKills`, `pMoney`,`pCash` ,`pTeamFaction`, `pStaff`, `pSaveSkin`, `pSelected`, `pCharater`, `pLoggedIn`, `pSpy`,`pFbi`, `pFaction`, `pQuit`, `pDeathRP`, `pSpawnPosX`, `pSpawnPosY`, `pSpawnPosZ`, `pSpawnSaved`, `pArmour`,`pHostAddress`, `pLastPlayed`, `pAmmo1`, `pAmmo2` WHERE `ID`=80"..
[14:57:22] [DEBUG] CMySQLQuery::Execute[()] - starting query execution
[14:57:22] [ERROR] CMySQLQuery::Execute[()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' `pIP`, `pAdmin`, `pKills`, `pMoney`,`pCash` ,`pTeamFaction`, `pStaff`, `pSaveSk' at line 1
[14:57:22] [DEBUG] CMySQLQuery::Execute[()] - error will be triggered in OnQueryError
[14:57:22] [DEBUG] CMySQLQuery::Execute[()] - data being passed to ProcessCallbacks()
[14:57:22] [DEBUG] Calling callback "OnQueryError"..
[14:57:22] [DEBUG] CMySQLQuery::~CMySQLQuery() - deconstructor called
Ok so after checking length of query i found that it was 479 more than current query holding var size which is 300.
Either follow the things I told you in previous reply to reduce the query size(recommended) or increase the query variable size to 500(not recommended).
If you didn't understand what I told in the last reply then tell me i'll try to explain in more details.
But as I told try to make query as small as possible, set the fields such as cash,admin..etc to 0 and then insert only name and IP. You don't need to insert all the fields at once!