SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 29/04/2020, 08:38 AM   #1
Mike861
Huge Clucker
 
Join Date: Feb 2018
Posts: 233
Reputation: 16
Default mysql not saving players data

I was looking at the mysql wiki for samp and a few tutorials and wrote down my login/register system. I'm new to mysql but i think i made it, atleast i'm almost there because something isn't right. The register dialog appears but once i enter the password, i don't get a account creation message and it doesn't save it. I used mysql_tquery and made a custom callback called OnPlayerRegister which executes that message and sets LoggedIn variable to true. But that doesn't work, it works only if i put the message and that variable inside the DIALOG_REGISTER, but then again it doesn't save it. What could it possibly be? I'll send code parts where needed.
Mike861 is offline   Reply With Quote
Old 29/04/2020, 08:52 AM   #2
Proxus
Huge Clucker
 
Proxus's Avatar
 
Join Date: May 2018
Location: United Kingdom
Posts: 461
Reputation: 20
Default Re: mysql not saving players data

Send the code where you save it to MySQL. Also, if you enable logging and you check your mysql.log file, there is likely to be an error.
__________________
Developer @ Trucknation
"Never tell people how to do things. Tell them what to do and they will surprise you with their ingenuity"


IMPORTANT LINKS
An upcoming mix of trucking & light roleplay
Proxus is online now   Reply With Quote
Old 29/04/2020, 08:55 AM   #3
Mike861
Huge Clucker
 
Join Date: Feb 2018
Posts: 233
Reputation: 16
Default Re: mysql not saving players data

Quote:
Originally Posted by Proxus View Post
Send the code where you save it to MySQL. Also, if you enable logging and you check your mysql.log file, there is likely to be an error.
This is under OnPlayerDisconnect for example:
Code:
mysql_format(mysql_database, query, sizeof(query),"UPDATE `PLAYERS` SET `MONEY` = '%d', `HEALTH` = '%f', `ARMOR` = '%f', `XPOS` = '%f', `YPOS` = '%f', `ZPOS` = '%f', `ANGLE` = '%f', `INTERIOR` = '%d', `VW` = '%d' WHERE `ID` = '%d') ", Player[playerid][Money], Player[playerid][Health], Player[playerid][Armor], Player[playerid][Xpos], Player[playerid][Ypos], Player[playerid][Zpos], Player[playerid][Angle], Player[playerid][Interior],Player[playerid][VirtualWorld], Player[playerid][ID]);
	mysql_tquery(mysql_database, query);
I also put mysql_log(ALL); in OnGameModeInit if that's correct, but i don't get anything in the log.
Edit: I didn't know where the log is, but now i found it. Sending in a bit.
Mike861 is offline   Reply With Quote
Old 29/04/2020, 09:01 AM   #4
Mike861
Huge Clucker
 
Join Date: Feb 2018
Posts: 233
Reputation: 16
Default Re: mysql not saving players data

Code:
[04/29/20 11:03:33] [INFO] changed log level from 'warning, error' to 'debug, info, warning, error'
[04/29/20 11:03:33] [DEBUG] mysql_connect("127.0.0.1", "server_707", "*****", "server_707_mickey", 0)
[04/29/20 11:03:33] [DEBUG] CHandleManager::Create(this=0x81d8568, host='127.0.0.1', user='server_707', pass='****', db='server_707_mickey', options=0x8283b38)
[04/29/20 11:03:33] [INFO] Creating new connection handle...
[04/29/20 11:03:33] [DEBUG] CConnection::CConnection(this=0x8305bc0, host='127.0.0.1', user='server_707', passw='****', db='server_707_mickey', options=0x8283b38)
[04/29/20 11:03:33] [DEBUG] CConnection::CConnection - new connection = 0x8306340
[04/29/20 11:03:33] [DEBUG] CConnection::CConnection(this=0xf537f008, host='127.0.0.1', user='server_707', passw='****', db='server_707_mickey', options=0x8283b38)
[04/29/20 11:03:33] [DEBUG] CConnection::CConnection - new connection = 0x831a8a0
[04/29/20 11:03:33] [DEBUG] CThreadedConnection::CThreadedConnection(this=0xf537f008, connection=0xf537f008)
[04/29/20 11:03:33] [DEBUG] CConnectionPool::CConnectionPool(size=2, this=0x8305ba0)
[04/29/20 11:03:33] [DEBUG] CConnection::CConnection(this=0xf4afd008, host='127.0.0.1', user='server_707', passw='****', db='server_707_mickey', options=0x8283b38)
[04/29/20 11:03:33] [DEBUG] CThreadedConnection::WorkerFunc(this=0xf537f008, connection=0xf537f008)
[04/29/20 11:03:33] [DEBUG] CConnection::CConnection - new connection = 0x831cea0
[04/29/20 11:03:33] [DEBUG] CThreadedConnection::CThreadedConnection(this=0xf4afd008, connection=0xf4afd008)
[04/29/20 11:03:33] [DEBUG] CConnection::CConnection(this=0xf4a7c008, host='127.0.0.1', user='server_707', passw='****', db='server_707_mickey', options=0x8283b38)
[04/29/20 11:03:33] [DEBUG] CThreadedConnection::WorkerFunc(this=0xf4afd008, connection=0xf4afd008)
[04/29/20 11:03:33] [DEBUG] CConnection::CConnection - new connection = 0x831f610
[04/29/20 11:03:33] [DEBUG] CThreadedConnection::CThreadedConnection(this=0xf4a7c008, connection=0xf4a7c008)
[04/29/20 11:03:33] [INFO] Connection handle with id '1' successfully created.
[04/29/20 11:03:33] [DEBUG] CHandleManager::Create - new handle = 0x8305a98
[04/29/20 11:03:33] [DEBUG] mysql_connect: return value: '1'
[04/29/20 11:03:33] [DEBUG] mysql_errno(1)
[04/29/20 11:03:33] [DEBUG] CHandle::GetErrorId(this=0x8305a98)
[04/29/20 11:03:33] [DEBUG] CConnection::GetError(this=0x8305bc0, connection=0x8306340)
[04/29/20 11:03:33] [DEBUG] CHandle::GetErrorId - return value: true, error id: '0', error msg: ''
[04/29/20 11:03:33] [DEBUG] mysql_errno: return value: '0'
[04/29/20 11:03:33] [DEBUG] mysql_tquery(1, "CREATE TABLE IF NOT EXISTS `PLAYERS` (`ID` int(11) NOT NULL AUTO_INCREMENT, `USERNAME` varchar(24) NOT NULL, `PASSWORD` char(65) NOT NULL, `SALT` char(11) NOT NULL, `MONEY` int(11) NOT NULL, `HEALTH` int(11) NOT NULL, `ARMOR` int(11) NOT NULL, `POSX` int(11) NOT NULL, `POSY` int(11) NOT NULL, `POSZ` int(11) NOT NULL, `ANGLE` int(11) NOT NULL, `INTERIOR` int(11) NOT NULL, `VIRTUALWORLD` int(11) NOT NULL, PRIMARY KEY (`ID`), UNIQUE KEY (`USERNAME`))", "", "")
[04/29/20 11:03:33] [DEBUG] CCallback::Create(amx=0x8303c00, name='', format='', params=0xf59b0870, param_offset=5)
[04/29/20 11:03:33] [DEBUG] CHandle::Execute(this=0x8305a98, type=1, query=0x8322424)
[04/29/20 11:03:33] [DEBUG] CHandle::Execute - return value: true
[04/29/20 11:03:33] [DEBUG] mysql_tquery: return value: '1'
[04/29/20 11:03:33] [DEBUG] CConnection::Execute(query=0x8322424, this=0xf537f008, connection=0x831a8a0)
[04/29/20 11:03:33] [DEBUG] CQuery::Execute(this=0x8322424, connection=0x831a8a0)
[04/29/20 11:03:33] [INFO] query "CREATE TABLE IF NOT EXISTS `PLAYERS` (`ID` int(11) NOT NULL AUTO_INCREMENT, `USERNAME` varchar(24) NOT NULL, `PASSWORD` char(65) NOT NULL, `SALT` char(11) NOT NULL, `MONEY` int(11) NOT NULL, `HEALTH` int(11) NOT NULL, `ARMOR` int(11) NOT NULL, `POSX` int(11) NOT NULL, `POSY` int(11) NOT NULL, `POSZ` int(11) NOT NULL, `ANGLE` int(11) NOT NULL, `INTERIOR` int(11) NOT NULL, `VIRTUALWORLD` int(11) NOT NULL, PRIMARY KEY (`ID`), UNIQUE KEY (`USERNAME`))" successfully executed within 0.712 milliseconds
[04/29/20 11:03:33] [DEBUG] CResultSet::Create(connection=0x831a8a0, query_str='CREATE TABLE IF NOT EXISTS `PLAYERS` (`ID` int(11) NOT NULL AUTO_INCREMENT, `USERNAME` varchar(24) NOT NULL, `PASSWORD` char(65) NOT NULL, `SALT` char(11) NOT NULL, `MONEY` int(11) NOT NULL, `HEALTH` int(11) NOT NULL, `ARMOR` int(11) NOT NULL, `POSX` int(11) NOT NULL, `POSY` int(11) NOT NULL, `POSZ` int(11) NOT NULL, `ANGLE` int(11) NOT NULL, `INTERIOR` int(11) NOT NULL, `VIRTUALWORLD` int(11) NOT NULL, PRIMARY KEY (`ID`), UNIQUE KEY (`USERNAME`))')
[04/29/20 11:03:33] [DEBUG] created new resultset '0xf49009a0'
[04/29/20 11:03:33] [DEBUG] fetched MySQL result '0x0'
[04/29/20 11:03:33] [DEBUG] CThreadedConnection::WorkerFunc(this=0xf4a7c008, connection=0xf4a7c008)
There's the log.

Code:
04/29/20 11:11:40] [DEBUG] mysql_format(1, 0xF59B0624, 128, "SELECT * FROM `PLAYERS` WHERE `USERNAME` = '%e' LIMIT 1")
[04/29/20 11:11:40] [DEBUG] CHandle::EscapeString(this=0x8305a98, src='Mickey')
[04/29/20 11:11:40] [DEBUG] CConnection::EscapeString(src='Mickey', this=0x8305bc0, connection=0x8306340)
[04/29/20 11:11:40] [DEBUG] CHandle::EscapeString - return value: true, escaped string: 'Mickey'
[04/29/20 11:11:40] [DEBUG] mysql_format: return value: '59'
[04/29/20 11:11:40] [DEBUG] mysql_tquery(1, "SELECT * FROM `PLAYERS` WHERE `USERNAME` = 'Mickey' LIMIT 1", "OnPlayerDataLoad", "d")
[04/29/20 11:11:40] [DEBUG] CCallback::Create(amx=0x8303c00, name='OnPlayerDataLoad', format='d', params=0xf59b060c, param_offset=5)
[04/29/20 11:11:40] [DEBUG] CCallback::Create - callback index for 'OnPlayerDataLoad': 5
[04/29/20 11:11:40] [DEBUG] processing specifier 'd' with parameter index 0
[04/29/20 11:11:40] [DEBUG] retrieved and pushed value '0'
[04/29/20 11:11:40] [INFO] Callback 'OnPlayerDataLoad' set up for delayed execution.
[04/29/20 11:11:40] [DEBUG] created delayed callback with 1 parameter
[04/29/20 11:11:40] [DEBUG] CHandle::Execute(this=0x8305a98, type=1, query=0x8321d24)
[04/29/20 11:11:40] [DEBUG] CHandle::Execute - return value: true
[04/29/20 11:11:40] [DEBUG] mysql_tquery: return value: '1'
[04/29/20 11:11:40] [DEBUG] CConnection::Execute(query=0x8321d24, this=0xf537f008, connection=0x831a8a0)
[04/29/20 11:11:40] [DEBUG] CQuery::Execute(this=0x8321d24, connection=0x831a8a0)
[04/29/20 11:11:40] [INFO] query "SELECT * FROM `PLAYERS` WHERE `USERNAME` = 'Mickey' LIMIT 1" successfully executed within 0.182 milliseconds
[04/29/20 11:11:40] [DEBUG] CResultSet::Create(connection=0x831a8a0, query_str='SELECT * FROM `PLAYERS` WHERE `USERNAME` = 'Mickey' LIMIT 1')
[04/29/20 11:11:40] [DEBUG] created new resultset '0xf4900a68'
[04/29/20 11:11:40] [DEBUG] fetched MySQL result '0xf49005a0'
[04/29/20 11:11:40] [DEBUG] allocated 0 bytes for PAWN result
[04/29/20 11:11:40] [DEBUG] CCallback::Execute(amx=0x8303c00, index=5, num_params=1)
[04/29/20 11:11:40] [INFO] Executing callback 'OnPlayerDataLoad' with 1 parameter...
[04/29/20 11:11:40] [DEBUG] processing internal specifier 'c'
[04/29/20 11:11:40] [DEBUG] pushed value '0' onto AMX stack
[04/29/20 11:11:40] [DEBUG] executing AMX callback with index '5'
[04/29/20 11:11:40] [DEBUG] cache_get_row_count(0xF59B0888)
[04/29/20 11:11:40] [DEBUG] cache_get_row_count: return value: '1'
[04/29/20 11:11:40] [DEBUG] AMX callback executed with error '0'
[04/29/20 11:11:40] [INFO] Callback successfully executed.
[04/29/20 11:11:42] [DEBUG] mysql_format(1, 0xF59B0504, 225, "INSERT INTO `PLAYERS` (`ID`, `USERNAME`, `PASSWORD`, `SALT`, `MONEY`, `HEALTH`, `ARMOR`, `XPOS`, `YPOS`, `ZPOS`, `ANGLE`, `INTERIOR`, `VW`) VALUES ('i', '%e', '%s', '%e', '%d', '%f', '%f', '%f', '%f', '%f', '%f', '%d', '%d')")
[04/29/20 11:11:42] [ERROR] mysql_format: destination size '225' is too small
[04/29/20 11:11:42] [DEBUG] mysql_format: return value: '0'
[04/29/20 11:11:42] [DEBUG] mysql_tquery(1, "", "OnPlayerRegister", "d")
[04/29/20 11:11:42] [DEBUG] CCallback::Create(amx=0x8303c00, name='OnPlayerRegister', format='d', params=0xf59b04ec, param_offset=5)
[04/29/20 11:11:42] [DEBUG] CCallback::Create - callback index for 'OnPlayerRegister': 9
[04/29/20 11:11:42] [DEBUG] processing specifier 'd' with parameter index 0
[04/29/20 11:11:42] [DEBUG] retrieved and pushed value '0'
[04/29/20 11:11:42] [INFO] Callback 'OnPlayerRegister' set up for delayed execution.
[04/29/20 11:11:42] [DEBUG] created delayed callback with 1 parameter
[04/29/20 11:11:42] [DEBUG] CHandle::Execute(this=0x8305a98, type=1, query=0x8322b14)
[04/29/20 11:11:42] [DEBUG] CHandle::Execute - return value: true
[04/29/20 11:11:42] [DEBUG] mysql_tquery: return value: '1'
[04/29/20 11:11:42] [DEBUG] CConnection::Execute(query=0x8322b14, this=0xf537f008, connection=0x831a8a0)
[04/29/20 11:11:42] [DEBUG] CQuery::Execute(this=0x8322b14, connection=0x831a8a0)
[04/29/20 11:11:42] [ERROR] error #1065 while executing query "": Query was empty
[04/29/20 11:11:42] [DEBUG] CConnection::GetError(this=0xf537f008, connection=0x831a8a0)
[04/29/20 11:11:42] [DEBUG] CCallback::Create(amx=0x8303c00, name='OnQueryError', format='dsssd)
[04/29/20 11:11:42] [DEBUG] CCallback::Create - callback index for 'OnQueryError': -10047
[04/29/20 11:11:42] [DEBUG] processing specifier 'd'
[04/29/20 11:11:42] [DEBUG] retrieved and pushed value '1065'
[04/29/20 11:11:42] [DEBUG] processing specifier 's'
[04/29/20 11:11:42] [DEBUG] retrieved and pushed value 'Query was empty'
[04/29/20 11:11:42] [DEBUG] processing specifier 's'
[04/29/20 11:11:42] [DEBUG] retrieved and pushed value 'OnPlayerRegister'
[04/29/20 11:11:42] [DEBUG] processing specifier 's'
[04/29/20 11:11:42] [DEBUG] retrieved and pushed value ''
[04/29/20 11:11:42] [DEBUG] processing specifier 'd'
[04/29/20 11:11:42] [DEBUG] retrieved and pushed value '1'
[04/29/20 11:11:42] [INFO] Callback 'OnQueryError' set up for delayed execution.
[04/29/20 11:11:42] [DEBUG] created delayed callback with 5 parameters
[04/29/20 11:11:42] [DEBUG] CCallback::Execute(amx=0x8303c00, index=-10047, num_params=5)
[04/29/20 11:11:42] [INFO] Executing callback '' with 5 parameters...
[04/29/20 11:11:42] [DEBUG] processing internal specifier 'c'
[04/29/20 11:11:42] [DEBUG] pushed value '1' onto AMX stack
[04/29/20 11:11:42] [DEBUG] processing internal specifier 's'
[04/29/20 11:11:42] [DEBUG] pushed value '' onto AMX stack
[04/29/20 11:11:42] [DEBUG] processing internal specifier 's'
[04/29/20 11:11:42] [DEBUG] pushed value 'OnPlayerRegister' onto AMX stack
[04/29/20 11:11:42] [DEBUG] processing internal specifier 's'
[04/29/20 11:11:42] [DEBUG] pushed value 'Query was empty' onto AMX stack
[04/29/20 11:11:42] [DEBUG] processing internal specifier 'c'
[04/29/20 11:11:42] [DEBUG] pushed value '1065' onto AMX stack
[04/29/20 11:11:42] [DEBUG] executing AMX callback with index '-10047'
[04/29/20 11:11:42] [DEBUG] AMX callback executed with error '0'
[04/29/20 11:11:42] [INFO] Callback successfully executed.
[04/29/20 11:11:46] [DEBUG] mysql_format(1, 0xF59B04FC, 225, "UPDATE `PLAYERS` SET `MONEY` = '%d', `HEALTH` = '%f', `ARMOR` = '%f', `XPOS` = '%f', `YPOS` = '%f', `ZPOS` = '%f', `ANGLE` = '%f', `INTERIOR` = '%d', `VW` = '%d' WHERE `ID` = '%d') ")
[04/29/20 11:11:46] [DEBUG] mysql_format: return value: '213'
[04/29/20 11:11:46] [DEBUG] mysql_tquery(1, "UPDATE `PLAYERS` SET `MONEY` = '0', `HEALTH` = '0.000000', `ARMOR` = '0.000000', `XPOS` = '0.000000', `YPOS` = '0.000000', `ZPOS` = '0.000000', `ANGLE` = '0.000000', `INTERIOR` = '0', `VW` = '0' WHERE `ID` = '0') ", "", "")
[04/29/20 11:11:46] [DEBUG] CCallback::Create(amx=0x8303c00, name='', format='', params=0xf59b04e8, param_offset=5)
[04/29/20 11:11:46] [DEBUG] CHandle::Execute(this=0x8305a98, type=1, query=0x8322b14)
[04/29/20 11:11:46] [DEBUG] CHandle::Execute - return value: true
[04/29/20 11:11:46] [DEBUG] mysql_tquery: return value: '1'
[04/29/20 11:11:46] [DEBUG] cache_is_valid(0)
[04/29/20 11:11:46] [DEBUG] cache_is_valid: return value: 'false'
[04/29/20 11:11:46] [DEBUG] CConnection::Execute(query=0x8322b14, this=0xf537f008, connection=0x831a8a0)
[04/29/20 11:11:46] [DEBUG] CQuery::Execute(this=0x8322b14, connection=0x831a8a0)
[04/29/20 11:11:46] [ERROR] error #1064 while executing query "UPDATE `PLAYERS` SET `MONEY` = '0', `HEALTH` = '0.000000', `ARMOR` = '0.000000', `XPOS` = '0.000000', `YPOS` = '0.000000', `ZPOS` = '0.000000', `ANGLE` = '0.000000', `INTERIOR` = '0', `VW` = '0' WHERE `ID` = '0') ": You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1
[04/29/20 11:11:46] [DEBUG] CConnection::GetError(this=0xf537f008, connection=0x831a8a0)
[04/29/20 11:11:46] [DEBUG] CCallback::Create(amx=0x8303c00, name='OnQueryError', format='dsssd)
[04/29/20 11:11:46] [DEBUG] CCallback::Create - callback index for 'OnQueryError': -10047
[04/29/20 11:11:46] [DEBUG] processing specifier 'd'
[04/29/20 11:11:46] [DEBUG] retrieved and pushed value '1064'
[04/29/20 11:11:46] [DEBUG] processing specifier 's'
[04/29/20 11:11:46] [DEBUG] retrieved and pushed value 'You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1'
[04/29/20 11:11:46] [DEBUG] processing specifier 's'
[04/29/20 11:11:46] [DEBUG] retrieved and pushed value ''
[04/29/20 11:11:46] [DEBUG] processing specifier 's'
[04/29/20 11:11:46] [DEBUG] retrieved and pushed value 'UPDATE `PLAYERS` SET `MONEY` = '0', `HEALTH` = '0.000000', `ARMOR` = '0.000000', `XPOS` = '0.000000', `YPOS` = '0.000000', `ZPOS` = '0.000000', `ANGLE` = '0.000000', `INTERIOR` = '0', `VW` = '0' WHERE `ID` = '0') '
[04/29/20 11:11:46] [DEBUG] processing specifier 'd'
[04/29/20 11:11:46] [DEBUG] retrieved and pushed value '1'
[04/29/20 11:11:46] [INFO] Callback 'OnQueryError' set up for delayed execution.
[04/29/20 11:11:46] [DEBUG] created delayed callback with 5 parameters
[04/29/20 11:11:46] [DEBUG] CCallback::Execute(amx=0x8303c00, index=-10047, num_params=5)
[04/29/20 11:11:46] [INFO] Executing callback '' with 5 parameters...
[04/29/20 11:11:46] [DEBUG] processing internal specifier 'c'
[04/29/20 11:11:46] [DEBUG] pushed value '1' onto AMX stack
[04/29/20 11:11:46] [DEBUG] processing internal specifier 's'
[04/29/20 11:11:46] [DEBUG] pushed value 'UPDATE `PLAYERS` SET `MONEY` = '0', `HEALTH` = '0.000000', `ARMOR` = '0.000000', `XPOS` = '0.000000', `YPOS` = '0.000000', `ZPOS` = '0.000000', `ANGLE` = '0.000000', `INTERIOR` = '0', `VW` = '0' WHERE `ID` = '0') ' onto AMX stack
[04/29/20 11:11:46] [DEBUG] processing internal specifier 's'
[04/29/20 11:11:46] [DEBUG] pushed value '' onto AMX stack
[04/29/20 11:11:46] [DEBUG] processing internal specifier 's'
[04/29/20 11:11:46] [DEBUG] pushed value 'You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1' onto AMX stack
[04/29/20 11:11:46] [DEBUG] processing internal specifier 'c'
[04/29/20 11:11:46] [DEBUG] pushed value '1064' onto AMX stack
[04/29/20 11:11:46] [DEBUG] executing AMX callback with index '-10047'
[04/29/20 11:11:46] [DEBUG] AMX callback executed with error '0'
[04/29/20 11:11:46] [INFO] Callback successfully executed.
And this appeared after i joined the server.
Mike861 is offline   Reply With Quote
Old 29/04/2020, 09:22 AM   #5
Proxus
Huge Clucker
 
Proxus's Avatar
 
Join Date: May 2018
Location: United Kingdom
Posts: 461
Reputation: 20
Default Re: mysql not saving players data

Code:
error #1065 while executing query "": Query was empty
[ERROR] mysql_format: destination size '225' is too small
[DEBUG] retrieved and pushed value 'You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1'
The first 2 errors are because your query size is too small. It needs to be greater than 225.
For example:
Code:
new Query[225];
For the second error, please paste the part of code where you're saving to MySQL.
__________________
Developer @ Trucknation
"Never tell people how to do things. Tell them what to do and they will surprise you with their ingenuity"


IMPORTANT LINKS
An upcoming mix of trucking & light roleplay
Proxus is online now   Reply With Quote
Old 29/04/2020, 09:23 AM   #6
Mike861
Huge Clucker
 
Join Date: Feb 2018
Posts: 233
Reputation: 16
Default Re: mysql not saving players data

Quote:
Originally Posted by Proxus View Post
Code:
error #1065 while executing query "": Query was empty
[ERROR] mysql_format: destination size '225' is too small
[DEBUG] retrieved and pushed value 'You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1'
The first 2 errors are because your query size is too small. It needs to be greater than 225.
For example:
Code:
new Query[225];
For the second error, please paste the part of code where you're saving to MySQL.
under case DIALOG_REGISTER:
Code:
mysql_format(mysql_database, query, sizeof(query), "INSERT INTO `PLAYERS` (`ID`, `USERNAME`, `PASSWORD`, `SALT`, `MONEY`, `HEALTH`, `ARMOR`, `XPOS`, `YPOS`, `ZPOS`, `ANGLE`, `INTERIOR`, `VW`) VALUES ('i', '%e', '%s', '%e', '%d', '%f', '%f', '%f', '%f', '%f', '%f', '%d', '%d')", Player[playerid][Name], Player[playerid][Password], Player[playerid][Salt], Player[playerid][Money], Player[playerid][Health], Player[playerid][Armor], Player[playerid][Xpos], Player[playerid][Ypos], Player[playerid][Zpos], Player[playerid][Angle], Player[playerid][Interior],Player[playerid][VirtualWorld]);
Mike861 is offline   Reply With Quote
Old 29/04/2020, 09:26 AM   #7
Proxus
Huge Clucker
 
Proxus's Avatar
 
Join Date: May 2018
Location: United Kingdom
Posts: 461
Reputation: 20
Default Re: mysql not saving players data

i should be %i.

You have 13 fields (e.g. `USERNAME`) & 13 format specifiers (e.g. %s). However, you only have 12 values (e.g. Player[playerid][Password]. Therefore, one format specifier is empty and that will error.
__________________
Developer @ Trucknation
"Never tell people how to do things. Tell them what to do and they will surprise you with their ingenuity"


IMPORTANT LINKS
An upcoming mix of trucking & light roleplay
Proxus is online now   Reply With Quote
Old 29/04/2020, 09:30 AM   #8
Mike861
Huge Clucker
 
Join Date: Feb 2018
Posts: 233
Reputation: 16
Default Re: mysql not saving players data

Quote:
Originally Posted by Proxus View Post
i should be %i.

You have 13 fields (e.g. `USERNAME`) & 13 format specifiers (e.g. %s). However, you only have 12 values (e.g. Player[playerid][Password]. Therefore, one format specifier is empty and that will error.
Yeah i didn't saw that thanks. But it still does not save.

Code:
[04/29/20 11:32:07] [DEBUG] mysql_connect("127.0.0.1", "server_707", "*****", "server_707_mickey", 0)
[04/29/20 11:32:07] [DEBUG] CHandleManager::Create(this=0x81d8568, host='127.0.0.1', user='server_707', pass='****', db='server_707_mickey', options=0x8283b38)
[04/29/20 11:32:07] [INFO] Creating new connection handle...
[04/29/20 11:32:07] [DEBUG] CConnection::CConnection(this=0x8305bc0, host='127.0.0.1', user='server_707', passw='****', db='server_707_mickey', options=0x8283b38)
[04/29/20 11:32:07] [DEBUG] CConnection::CConnection - new connection = 0x8306340
[04/29/20 11:32:07] [DEBUG] CConnection::CConnection(this=0xf5504008, host='127.0.0.1', user='server_707', passw='****', db='server_707_mickey', options=0x8283b38)
[04/29/20 11:32:07] [DEBUG] CConnection::CConnection - new connection = 0x831a8a0
[04/29/20 11:32:07] [DEBUG] CThreadedConnection::CThreadedConnection(this=0xf5504008, connection=0xf5504008)
[04/29/20 11:32:07] [DEBUG] CConnectionPool::CConnectionPool(size=2, this=0x8305ba0)
[04/29/20 11:32:07] [DEBUG] CConnection::CConnection(this=0xf4b7e008, host='127.0.0.1', user='server_707', passw='****', db='server_707_mickey', options=0x8283b38)
[04/29/20 11:32:07] [DEBUG] CConnection::CConnection - new connection = 0x831cea0
[04/29/20 11:32:07] [DEBUG] CThreadedConnection::CThreadedConnection(this=0xf4b7e008, connection=0xf4b7e008)
[04/29/20 11:32:07] [DEBUG] CConnection::CConnection(this=0xf42fc008, host='127.0.0.1', user='server_707', passw='****', db='server_707_mickey', options=0x8283b38)
[04/29/20 11:32:07] [DEBUG] CConnection::CConnection - new connection = 0x831f610
[04/29/20 11:32:07] [DEBUG] CThreadedConnection::CThreadedConnection(this=0xf42fc008, connection=0xf42fc008)
[04/29/20 11:32:07] [INFO] Connection handle with id '1' successfully created.
[04/29/20 11:32:07] [DEBUG] CHandleManager::Create - new handle = 0x8305a98
[04/29/20 11:32:07] [DEBUG] mysql_connect: return value: '1'
[04/29/20 11:32:07] [DEBUG] mysql_errno(1)
[04/29/20 11:32:07] [DEBUG] CHandle::GetErrorId(this=0x8305a98)
[04/29/20 11:32:07] [DEBUG] CConnection::GetError(this=0x8305bc0, connection=0x8306340)
[04/29/20 11:32:07] [DEBUG] CHandle::GetErrorId - return value: true, error id: '0', error msg: ''
[04/29/20 11:32:07] [DEBUG] mysql_errno: return value: '0'
[04/29/20 11:32:07] [DEBUG] mysql_tquery(1, "CREATE TABLE IF NOT EXISTS `PLAYERS` (`ID` int(11) NOT NULL AUTO_INCREMENT, `USERNAME` varchar(24) NOT NULL, `PASSWORD` char(65) NOT NULL, `SALT` char(11) NOT NULL, `MONEY` int(11) NOT NULL, `HEALTH` int(11) NOT NULL, `ARMOR` int(11) NOT NULL, `POSX` int(11) NOT NULL, `POSY` int(11) NOT NULL, `POSZ` int(11) NOT NULL, `ANGLE` int(11) NOT NULL, `INTERIOR` int(11) NOT NULL, `VIRTUALWORLD` int(11) NOT NULL, PRIMARY KEY (`ID`), UNIQUE KEY (`USERNAME`))", "", "")
[04/29/20 11:32:07] [DEBUG] CCallback::Create(amx=0x8303c00, name='', format='', params=0xf5a0d874, param_offset=5)
[04/29/20 11:32:07] [DEBUG] CHandle::Execute(this=0x8305a98, type=1, query=0x8321b7c)
[04/29/20 11:32:07] [DEBUG] CHandle::Execute - return value: true
[04/29/20 11:32:07] [DEBUG] mysql_tquery: return value: '1'
[04/29/20 11:32:07] [DEBUG] CThreadedConnection::WorkerFunc(this=0xf42fc008, connection=0xf42fc008)
[04/29/20 11:32:07] [DEBUG] CThreadedConnection::WorkerFunc(this=0xf5504008, connection=0xf5504008)
[04/29/20 11:32:07] [DEBUG] CThreadedConnection::WorkerFunc(this=0xf4b7e008, connection=0xf4b7e008)
[04/29/20 11:32:51] [DEBUG] mysql_format(1, 0xF5A0D4A4, 225, "SELECT * FROM `PLAYERS` WHERE `USERNAME` = '%e' LIMIT 1")
[04/29/20 11:32:51] [DEBUG] CHandle::EscapeString(this=0x8305a98, src='Mickey')
[04/29/20 11:32:51] [DEBUG] CConnection::EscapeString(src='Mickey', this=0x8305bc0, connection=0x8306340)
[04/29/20 11:32:51] [DEBUG] CHandle::EscapeString - return value: true, escaped string: 'Mickey'
[04/29/20 11:32:51] [DEBUG] mysql_format: return value: '59'
[04/29/20 11:32:51] [DEBUG] mysql_tquery(1, "SELECT * FROM `PLAYERS` WHERE `USERNAME` = 'Mickey' LIMIT 1", "OnPlayerDataLoad", "d")
[04/29/20 11:32:51] [DEBUG] CCallback::Create(amx=0x8303c00, name='OnPlayerDataLoad', format='d', params=0xf5a0d48c, param_offset=5)
[04/29/20 11:32:51] [DEBUG] CCallback::Create - callback index for 'OnPlayerDataLoad': 5
[04/29/20 11:32:51] [DEBUG] processing specifier 'd' with parameter index 0
[04/29/20 11:32:51] [DEBUG] retrieved and pushed value '0'
[04/29/20 11:32:51] [INFO] Callback 'OnPlayerDataLoad' set up for delayed execution.
[04/29/20 11:32:51] [DEBUG] created delayed callback with 1 parameter
[04/29/20 11:32:51] [DEBUG] CHandle::Execute(this=0x8305a98, type=1, query=0x8329874)
[04/29/20 11:32:51] [DEBUG] CHandle::Execute - return value: true
[04/29/20 11:32:51] [DEBUG] mysql_tquery: return value: '1'
[04/29/20 11:32:51] [DEBUG] CConnection::Execute(query=0x8321b7c, this=0xf5504008, connection=0x831a8a0)
[04/29/20 11:32:51] [DEBUG] CQuery::Execute(this=0x8321b7c, connection=0x831a8a0)
[04/29/20 11:32:51] [INFO] query "CREATE TABLE IF NOT EXISTS `PLAYERS` (`ID` int(11) NOT NULL AUTO_INCREMENT, `USERNAME` varchar(24) NOT NULL, `PASSWORD` char(65) NOT NULL, `SALT` char(11) NOT NULL, `MONEY` int(11) NOT NULL, `HEALTH` int(11) NOT NULL, `ARMOR` int(11) NOT NULL, `POSX` int(11) NOT NULL, `POSY` int(11) NOT NULL, `POSZ` int(11) NOT NULL, `ANGLE` int(11) NOT NULL, `INTERIOR` int(11) NOT NULL, `VIRTUALWORLD` int(11) NOT NULL, PRIMARY KEY (`ID`), UNIQUE KEY (`USERNAME`))" successfully executed within 0.460 milliseconds
[04/29/20 11:32:51] [DEBUG] CResultSet::Create(connection=0x831a8a0, query_str='CREATE TABLE IF NOT EXISTS `PLAYERS` (`ID` int(11) NOT NULL AUTO_INCREMENT, `USERNAME` varchar(24) NOT NULL, `PASSWORD` char(65) NOT NULL, `SALT` char(11) NOT NULL, `MONEY` int(11) NOT NULL, `HEALTH` int(11) NOT NULL, `ARMOR` int(11) NOT NULL, `POSX` int(11) NOT NULL, `POSY` int(11) NOT NULL, `POSZ` int(11) NOT NULL, `ANGLE` int(11) NOT NULL, `INTERIOR` int(11) NOT NULL, `VIRTUALWORLD` int(11) NOT NULL, PRIMARY KEY (`ID`), UNIQUE KEY (`USERNAME`))')
[04/29/20 11:32:51] [DEBUG] created new resultset '0xf3700b00'
[04/29/20 11:32:51] [DEBUG] fetched MySQL result '0x0'
[04/29/20 11:32:51] [DEBUG] CConnection::Execute(query=0x8329874, this=0xf5504008, connection=0x831a8a0)
[04/29/20 11:32:51] [DEBUG] CQuery::Execute(this=0x8329874, connection=0x831a8a0)
[04/29/20 11:32:51] [INFO] query "SELECT * FROM `PLAYERS` WHERE `USERNAME` = 'Mickey' LIMIT 1" successfully executed within 0.891 milliseconds
[04/29/20 11:32:51] [DEBUG] CResultSet::Create(connection=0x831a8a0, query_str='SELECT * FROM `PLAYERS` WHERE `USERNAME` = 'Mickey' LIMIT 1')
[04/29/20 11:32:51] [DEBUG] created new resultset '0xf3700b20'
[04/29/20 11:32:51] [DEBUG] fetched MySQL result '0xf3700738'
[04/29/20 11:32:51] [DEBUG] allocated 0 bytes for PAWN result
[04/29/20 11:32:51] [DEBUG] CCallback::Execute(amx=0x8303c00, index=5, num_params=1)
[04/29/20 11:32:51] [INFO] Executing callback 'OnPlayerDataLoad' with 1 parameter...
[04/29/20 11:32:51] [DEBUG] processing internal specifier 'c'
[04/29/20 11:32:51] [DEBUG] pushed value '0' onto AMX stack
[04/29/20 11:32:51] [DEBUG] executing AMX callback with index '5'
[04/29/20 11:32:51] [DEBUG] cache_get_row_count(0xF5A0D88C)
[04/29/20 11:32:51] [DEBUG] cache_get_row_count: return value: '1'
[04/29/20 11:32:51] [DEBUG] AMX callback executed with error '0'
[04/29/20 11:32:51] [INFO] Callback successfully executed.
[04/29/20 11:32:57] [DEBUG] mysql_format(1, 0xF5A0D508, 225, "INSERT INTO `PLAYERS` (`ID`, `USERNAME`, `PASSWORD`, `SALT`, `MONEY`, `HEALTH`, `ARMOR`, `XPOS`, `YPOS`, `ZPOS`, `ANGLE`, `INTERIOR`, `VW`) VALUES ('%i', '%e', '%s', '%e', '%d', '%f', '%f', '%f', '%f', '%f', '%f', '%d', '%d')")
[04/29/20 11:32:57] [DEBUG] CHandle::EscapeString(this=0x8305a98, src='03FFA888C307107BA1E6F499CE842A858308532698958BF92824175795418EC9')
[04/29/20 11:32:57] [DEBUG] CConnection::EscapeString(src='03FFA888C307107BA1E6F499CE842A858308532698958BF92824175795418EC9', this=0x8305bc0, connection=0x8306340)
[04/29/20 11:32:57] [DEBUG] CHandle::EscapeString - return value: true, escaped string: '03FFA888C307107BA1E6F499CE842A858308532698958BF92824175795418EC9'
[04/29/20 11:32:57] [ERROR] mysql_format: destination size '225' is too small
[04/29/20 11:32:57] [DEBUG] mysql_format: return value: '0'
[04/29/20 11:32:57] [DEBUG] mysql_tquery(1, "", "OnPlayerRegister", "d")
[04/29/20 11:32:57] [DEBUG] CCallback::Create(amx=0x8303c00, name='OnPlayerRegister', format='d', params=0xf5a0d4f0, param_offset=5)
[04/29/20 11:32:57] [DEBUG] CCallback::Create - callback index for 'OnPlayerRegister': 9
[04/29/20 11:32:57] [DEBUG] processing specifier 'd' with parameter index 0
[04/29/20 11:32:57] [DEBUG] retrieved and pushed value '0'
[04/29/20 11:32:57] [INFO] Callback 'OnPlayerRegister' set up for delayed execution.
[04/29/20 11:32:57] [DEBUG] created delayed callback with 1 parameter
[04/29/20 11:32:57] [DEBUG] CHandle::Execute(this=0x8305a98, type=1, query=0x83299bc)
[04/29/20 11:32:57] [DEBUG] CHandle::Execute - return value: true
[04/29/20 11:32:57] [DEBUG] mysql_tquery: return value: '1'
[04/29/20 11:32:57] [DEBUG] CConnection::Execute(query=0x83299bc, this=0xf5504008, connection=0x831a8a0)
[04/29/20 11:32:57] [DEBUG] CQuery::Execute(this=0x83299bc, connection=0x831a8a0)
[04/29/20 11:32:57] [ERROR] error #1065 while executing query "": Query was empty
[04/29/20 11:32:57] [DEBUG] CConnection::GetError(this=0xf5504008, connection=0x831a8a0)
[04/29/20 11:32:57] [DEBUG] CCallback::Create(amx=0x8303c00, name='OnQueryError', format='dsssd)
[04/29/20 11:32:57] [DEBUG] CCallback::Create - callback index for 'OnQueryError': -10047
[04/29/20 11:32:57] [DEBUG] processing specifier 'd'
[04/29/20 11:32:57] [DEBUG] retrieved and pushed value '1065'
[04/29/20 11:32:57] [DEBUG] processing specifier 's'
[04/29/20 11:32:57] [DEBUG] retrieved and pushed value 'Query was empty'
[04/29/20 11:32:57] [DEBUG] processing specifier 's'
[04/29/20 11:32:57] [DEBUG] retrieved and pushed value 'OnPlayerRegister'
[04/29/20 11:32:57] [DEBUG] processing specifier 's'
[04/29/20 11:32:57] [DEBUG] retrieved and pushed value ''
[04/29/20 11:32:57] [DEBUG] processing specifier 'd'
[04/29/20 11:32:57] [DEBUG] retrieved and pushed value '1'
[04/29/20 11:32:57] [INFO] Callback 'OnQueryError' set up for delayed execution.
[04/29/20 11:32:57] [DEBUG] created delayed callback with 5 parameters
[04/29/20 11:32:57] [DEBUG] CCallback::Execute(amx=0x8303c00, index=-10047, num_params=5)
[04/29/20 11:32:57] [INFO] Executing callback 'ŮW' with 5 parameters...
[04/29/20 11:32:57] [DEBUG] processing internal specifier 'c'
[04/29/20 11:32:57] [DEBUG] pushed value '1' onto AMX stack
[04/29/20 11:32:57] [DEBUG] processing internal specifier 's'
[04/29/20 11:32:57] [DEBUG] pushed value '' onto AMX stack
[04/29/20 11:32:57] [DEBUG] processing internal specifier 's'
[04/29/20 11:32:57] [DEBUG] pushed value 'OnPlayerRegister' onto AMX stack
[04/29/20 11:32:57] [DEBUG] processing internal specifier 's'
[04/29/20 11:32:57] [DEBUG] pushed value 'Query was empty' onto AMX stack
[04/29/20 11:32:57] [DEBUG] processing internal specifier 'c'
[04/29/20 11:32:57] [DEBUG] pushed value '1065' onto AMX stack
[04/29/20 11:32:57] [DEBUG] executing AMX callback with index '-10047'
[04/29/20 11:32:57] [DEBUG] AMX callback executed with error '0'
[04/29/20 11:32:57] [INFO] Callback successfully executed.
[04/29/20 11:33:00] [DEBUG] mysql_format(1, 0xF5A0D500, 225, "UPDATE `PLAYERS` SET `MONEY` = '%d', `HEALTH` = '%f', `ARMOR` = '%f', `XPOS` = '%f', `YPOS` = '%f', `ZPOS` = '%f', `ANGLE` = '%f', `INTERIOR` = '%d', `VW` = '%d' WHERE `ID` = '%d') ")
[04/29/20 11:33:00] [DEBUG] mysql_format: return value: '213'
[04/29/20 11:33:00] [DEBUG] mysql_tquery(1, "UPDATE `PLAYERS` SET `MONEY` = '0', `HEALTH` = '0.000000', `ARMOR` = '0.000000', `XPOS` = '0.000000', `YPOS` = '0.000000', `ZPOS` = '0.000000', `ANGLE` = '0.000000', `INTERIOR` = '0', `VW` = '0' WHERE `ID` = '0') ", "", "")
[04/29/20 11:33:00] [DEBUG] CCallback::Create(amx=0x8303c00, name='', format='', params=0xf5a0d4ec, param_offset=5)
[04/29/20 11:33:00] [DEBUG] CHandle::Execute(this=0x8305a98, type=1, query=0x8329d3c)
[04/29/20 11:33:00] [DEBUG] CHandle::Execute - return value: true
[04/29/20 11:33:00] [DEBUG] mysql_tquery: return value: '1'
[04/29/20 11:33:00] [DEBUG] cache_is_valid(0)
[04/29/20 11:33:00] [DEBUG] cache_is_valid: return value: 'false'
[04/29/20 11:33:00] [DEBUG] CConnection::Execute(query=0x8329d3c, this=0xf5504008, connection=0x831a8a0)
[04/29/20 11:33:00] [DEBUG] CQuery::Execute(this=0x8329d3c, connection=0x831a8a0)
[04/29/20 11:33:00] [ERROR] error #1064 while executing query "UPDATE `PLAYERS` SET `MONEY` = '0', `HEALTH` = '0.000000', `ARMOR` = '0.000000', `XPOS` = '0.000000', `YPOS` = '0.000000', `ZPOS` = '0.000000', `ANGLE` = '0.000000', `INTERIOR` = '0', `VW` = '0' WHERE `ID` = '0') ": You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1
[04/29/20 11:33:00] [DEBUG] CConnection::GetError(this=0xf5504008, connection=0x831a8a0)
[04/29/20 11:33:00] [DEBUG] CCallback::Create(amx=0x8303c00, name='OnQueryError', format='dsssd)
[04/29/20 11:33:00] [DEBUG] CCallback::Create - callback index for 'OnQueryError': -10047
[04/29/20 11:33:00] [DEBUG] processing specifier 'd'
[04/29/20 11:33:00] [DEBUG] retrieved and pushed value '1064'
[04/29/20 11:33:00] [DEBUG] processing specifier 's'
[04/29/20 11:33:00] [DEBUG] retrieved and pushed value 'You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1'
[04/29/20 11:33:00] [DEBUG] processing specifier 's'
[04/29/20 11:33:00] [DEBUG] retrieved and pushed value ''
[04/29/20 11:33:00] [DEBUG] processing specifier 's'
[04/29/20 11:33:00] [DEBUG] retrieved and pushed value 'UPDATE `PLAYERS` SET `MONEY` = '0', `HEALTH` = '0.000000', `ARMOR` = '0.000000', `XPOS` = '0.000000', `YPOS` = '0.000000', `ZPOS` = '0.000000', `ANGLE` = '0.000000', `INTERIOR` = '0', `VW` = '0' WHERE `ID` = '0') '
[04/29/20 11:33:00] [DEBUG] processing specifier 'd'
[04/29/20 11:33:00] [DEBUG] retrieved and pushed value '1'
[04/29/20 11:33:00] [INFO] Callback 'OnQueryError' set up for delayed execution.
[04/29/20 11:33:00] [DEBUG] created delayed callback with 5 parameters
[04/29/20 11:33:00] [DEBUG] CCallback::Execute(amx=0x8303c00, index=-10047, num_params=5)
[04/29/20 11:33:00] [INFO] Executing callback 'ŮW' with 5 parameters...
[04/29/20 11:33:00] [DEBUG] processing internal specifier 'c'
[04/29/20 11:33:00] [DEBUG] pushed value '1' onto AMX stack
[04/29/20 11:33:00] [DEBUG] processing internal specifier 's'
[04/29/20 11:33:00] [DEBUG] pushed value 'UPDATE `PLAYERS` SET `MONEY` = '0', `HEALTH` = '0.000000', `ARMOR` = '0.000000', `XPOS` = '0.000000', `YPOS` = '0.000000', `ZPOS` = '0.000000', `ANGLE` = '0.000000', `INTERIOR` = '0', `VW` = '0' WHERE `ID` = '0') ' onto AMX stack
[04/29/20 11:33:00] [DEBUG] processing internal specifier 's'
[04/29/20 11:33:00] [DEBUG] pushed value '' onto AMX stack
[04/29/20 11:33:00] [DEBUG] processing internal specifier 's'
[04/29/20 11:33:00] [DEBUG] pushed value 'You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1' onto AMX stack
[04/29/20 11:33:00] [DEBUG] processing internal specifier 'c'
[04/29/20 11:33:00] [DEBUG] pushed value '1064' onto AMX stack
[04/29/20 11:33:00] [DEBUG] executing AMX callback with index '-10047'
[04/29/20 11:33:00] [DEBUG] AMX callback executed with error '0'
[04/29/20 11:33:00] [INFO] Callback successfully executed.
I guess the size should be even larger than 225?
Mike861 is offline   Reply With Quote
Old 29/04/2020, 09:33 AM   #9
Proxus
Huge Clucker
 
Proxus's Avatar
 
Join Date: May 2018
Location: United Kingdom
Posts: 461
Reputation: 20
Default Re: mysql not saving players data

Quote:
Originally Posted by Mike861 View Post
Yeah i didn't saw that thanks. But it still does not save.

Code:
[04/29/20 11:32:07] [DEBUG] mysql_connect("127.0.0.1", "server_707", "*****", "server_707_mickey", 0)
[04/29/20 11:32:07] [DEBUG] CHandleManager::Create(this=0x81d8568, host='127.0.0.1', user='server_707', pass='****', db='server_707_mickey', options=0x8283b38)
[04/29/20 11:32:07] [INFO] Creating new connection handle...
[04/29/20 11:32:07] [DEBUG] CConnection::CConnection(this=0x8305bc0, host='127.0.0.1', user='server_707', passw='****', db='server_707_mickey', options=0x8283b38)
[04/29/20 11:32:07] [DEBUG] CConnection::CConnection - new connection = 0x8306340
[04/29/20 11:32:07] [DEBUG] CConnection::CConnection(this=0xf5504008, host='127.0.0.1', user='server_707', passw='****', db='server_707_mickey', options=0x8283b38)
[04/29/20 11:32:07] [DEBUG] CConnection::CConnection - new connection = 0x831a8a0
[04/29/20 11:32:07] [DEBUG] CThreadedConnection::CThreadedConnection(this=0xf5504008, connection=0xf5504008)
[04/29/20 11:32:07] [DEBUG] CConnectionPool::CConnectionPool(size=2, this=0x8305ba0)
[04/29/20 11:32:07] [DEBUG] CConnection::CConnection(this=0xf4b7e008, host='127.0.0.1', user='server_707', passw='****', db='server_707_mickey', options=0x8283b38)
[04/29/20 11:32:07] [DEBUG] CConnection::CConnection - new connection = 0x831cea0
[04/29/20 11:32:07] [DEBUG] CThreadedConnection::CThreadedConnection(this=0xf4b7e008, connection=0xf4b7e008)
[04/29/20 11:32:07] [DEBUG] CConnection::CConnection(this=0xf42fc008, host='127.0.0.1', user='server_707', passw='****', db='server_707_mickey', options=0x8283b38)
[04/29/20 11:32:07] [DEBUG] CConnection::CConnection - new connection = 0x831f610
[04/29/20 11:32:07] [DEBUG] CThreadedConnection::CThreadedConnection(this=0xf42fc008, connection=0xf42fc008)
[04/29/20 11:32:07] [INFO] Connection handle with id '1' successfully created.
[04/29/20 11:32:07] [DEBUG] CHandleManager::Create - new handle = 0x8305a98
[04/29/20 11:32:07] [DEBUG] mysql_connect: return value: '1'
[04/29/20 11:32:07] [DEBUG] mysql_errno(1)
[04/29/20 11:32:07] [DEBUG] CHandle::GetErrorId(this=0x8305a98)
[04/29/20 11:32:07] [DEBUG] CConnection::GetError(this=0x8305bc0, connection=0x8306340)
[04/29/20 11:32:07] [DEBUG] CHandle::GetErrorId - return value: true, error id: '0', error msg: ''
[04/29/20 11:32:07] [DEBUG] mysql_errno: return value: '0'
[04/29/20 11:32:07] [DEBUG] mysql_tquery(1, "CREATE TABLE IF NOT EXISTS `PLAYERS` (`ID` int(11) NOT NULL AUTO_INCREMENT, `USERNAME` varchar(24) NOT NULL, `PASSWORD` char(65) NOT NULL, `SALT` char(11) NOT NULL, `MONEY` int(11) NOT NULL, `HEALTH` int(11) NOT NULL, `ARMOR` int(11) NOT NULL, `POSX` int(11) NOT NULL, `POSY` int(11) NOT NULL, `POSZ` int(11) NOT NULL, `ANGLE` int(11) NOT NULL, `INTERIOR` int(11) NOT NULL, `VIRTUALWORLD` int(11) NOT NULL, PRIMARY KEY (`ID`), UNIQUE KEY (`USERNAME`))", "", "")
[04/29/20 11:32:07] [DEBUG] CCallback::Create(amx=0x8303c00, name='', format='', params=0xf5a0d874, param_offset=5)
[04/29/20 11:32:07] [DEBUG] CHandle::Execute(this=0x8305a98, type=1, query=0x8321b7c)
[04/29/20 11:32:07] [DEBUG] CHandle::Execute - return value: true
[04/29/20 11:32:07] [DEBUG] mysql_tquery: return value: '1'
[04/29/20 11:32:07] [DEBUG] CThreadedConnection::WorkerFunc(this=0xf42fc008, connection=0xf42fc008)
[04/29/20 11:32:07] [DEBUG] CThreadedConnection::WorkerFunc(this=0xf5504008, connection=0xf5504008)
[04/29/20 11:32:07] [DEBUG] CThreadedConnection::WorkerFunc(this=0xf4b7e008, connection=0xf4b7e008)
[04/29/20 11:32:51] [DEBUG] mysql_format(1, 0xF5A0D4A4, 225, "SELECT * FROM `PLAYERS` WHERE `USERNAME` = '%e' LIMIT 1")
[04/29/20 11:32:51] [DEBUG] CHandle::EscapeString(this=0x8305a98, src='Mickey')
[04/29/20 11:32:51] [DEBUG] CConnection::EscapeString(src='Mickey', this=0x8305bc0, connection=0x8306340)
[04/29/20 11:32:51] [DEBUG] CHandle::EscapeString - return value: true, escaped string: 'Mickey'
[04/29/20 11:32:51] [DEBUG] mysql_format: return value: '59'
[04/29/20 11:32:51] [DEBUG] mysql_tquery(1, "SELECT * FROM `PLAYERS` WHERE `USERNAME` = 'Mickey' LIMIT 1", "OnPlayerDataLoad", "d")
[04/29/20 11:32:51] [DEBUG] CCallback::Create(amx=0x8303c00, name='OnPlayerDataLoad', format='d', params=0xf5a0d48c, param_offset=5)
[04/29/20 11:32:51] [DEBUG] CCallback::Create - callback index for 'OnPlayerDataLoad': 5
[04/29/20 11:32:51] [DEBUG] processing specifier 'd' with parameter index 0
[04/29/20 11:32:51] [DEBUG] retrieved and pushed value '0'
[04/29/20 11:32:51] [INFO] Callback 'OnPlayerDataLoad' set up for delayed execution.
[04/29/20 11:32:51] [DEBUG] created delayed callback with 1 parameter
[04/29/20 11:32:51] [DEBUG] CHandle::Execute(this=0x8305a98, type=1, query=0x8329874)
[04/29/20 11:32:51] [DEBUG] CHandle::Execute - return value: true
[04/29/20 11:32:51] [DEBUG] mysql_tquery: return value: '1'
[04/29/20 11:32:51] [DEBUG] CConnection::Execute(query=0x8321b7c, this=0xf5504008, connection=0x831a8a0)
[04/29/20 11:32:51] [DEBUG] CQuery::Execute(this=0x8321b7c, connection=0x831a8a0)
[04/29/20 11:32:51] [INFO] query "CREATE TABLE IF NOT EXISTS `PLAYERS` (`ID` int(11) NOT NULL AUTO_INCREMENT, `USERNAME` varchar(24) NOT NULL, `PASSWORD` char(65) NOT NULL, `SALT` char(11) NOT NULL, `MONEY` int(11) NOT NULL, `HEALTH` int(11) NOT NULL, `ARMOR` int(11) NOT NULL, `POSX` int(11) NOT NULL, `POSY` int(11) NOT NULL, `POSZ` int(11) NOT NULL, `ANGLE` int(11) NOT NULL, `INTERIOR` int(11) NOT NULL, `VIRTUALWORLD` int(11) NOT NULL, PRIMARY KEY (`ID`), UNIQUE KEY (`USERNAME`))" successfully executed within 0.460 milliseconds
[04/29/20 11:32:51] [DEBUG] CResultSet::Create(connection=0x831a8a0, query_str='CREATE TABLE IF NOT EXISTS `PLAYERS` (`ID` int(11) NOT NULL AUTO_INCREMENT, `USERNAME` varchar(24) NOT NULL, `PASSWORD` char(65) NOT NULL, `SALT` char(11) NOT NULL, `MONEY` int(11) NOT NULL, `HEALTH` int(11) NOT NULL, `ARMOR` int(11) NOT NULL, `POSX` int(11) NOT NULL, `POSY` int(11) NOT NULL, `POSZ` int(11) NOT NULL, `ANGLE` int(11) NOT NULL, `INTERIOR` int(11) NOT NULL, `VIRTUALWORLD` int(11) NOT NULL, PRIMARY KEY (`ID`), UNIQUE KEY (`USERNAME`))')
[04/29/20 11:32:51] [DEBUG] created new resultset '0xf3700b00'
[04/29/20 11:32:51] [DEBUG] fetched MySQL result '0x0'
[04/29/20 11:32:51] [DEBUG] CConnection::Execute(query=0x8329874, this=0xf5504008, connection=0x831a8a0)
[04/29/20 11:32:51] [DEBUG] CQuery::Execute(this=0x8329874, connection=0x831a8a0)
[04/29/20 11:32:51] [INFO] query "SELECT * FROM `PLAYERS` WHERE `USERNAME` = 'Mickey' LIMIT 1" successfully executed within 0.891 milliseconds
[04/29/20 11:32:51] [DEBUG] CResultSet::Create(connection=0x831a8a0, query_str='SELECT * FROM `PLAYERS` WHERE `USERNAME` = 'Mickey' LIMIT 1')
[04/29/20 11:32:51] [DEBUG] created new resultset '0xf3700b20'
[04/29/20 11:32:51] [DEBUG] fetched MySQL result '0xf3700738'
[04/29/20 11:32:51] [DEBUG] allocated 0 bytes for PAWN result
[04/29/20 11:32:51] [DEBUG] CCallback::Execute(amx=0x8303c00, index=5, num_params=1)
[04/29/20 11:32:51] [INFO] Executing callback 'OnPlayerDataLoad' with 1 parameter...
[04/29/20 11:32:51] [DEBUG] processing internal specifier 'c'
[04/29/20 11:32:51] [DEBUG] pushed value '0' onto AMX stack
[04/29/20 11:32:51] [DEBUG] executing AMX callback with index '5'
[04/29/20 11:32:51] [DEBUG] cache_get_row_count(0xF5A0D88C)
[04/29/20 11:32:51] [DEBUG] cache_get_row_count: return value: '1'
[04/29/20 11:32:51] [DEBUG] AMX callback executed with error '0'
[04/29/20 11:32:51] [INFO] Callback successfully executed.
[04/29/20 11:32:57] [DEBUG] mysql_format(1, 0xF5A0D508, 225, "INSERT INTO `PLAYERS` (`ID`, `USERNAME`, `PASSWORD`, `SALT`, `MONEY`, `HEALTH`, `ARMOR`, `XPOS`, `YPOS`, `ZPOS`, `ANGLE`, `INTERIOR`, `VW`) VALUES ('%i', '%e', '%s', '%e', '%d', '%f', '%f', '%f', '%f', '%f', '%f', '%d', '%d')")
[04/29/20 11:32:57] [DEBUG] CHandle::EscapeString(this=0x8305a98, src='03FFA888C307107BA1E6F499CE842A858308532698958BF92824175795418EC9')
[04/29/20 11:32:57] [DEBUG] CConnection::EscapeString(src='03FFA888C307107BA1E6F499CE842A858308532698958BF92824175795418EC9', this=0x8305bc0, connection=0x8306340)
[04/29/20 11:32:57] [DEBUG] CHandle::EscapeString - return value: true, escaped string: '03FFA888C307107BA1E6F499CE842A858308532698958BF92824175795418EC9'
[04/29/20 11:32:57] [ERROR] mysql_format: destination size '225' is too small
[04/29/20 11:32:57] [DEBUG] mysql_format: return value: '0'
[04/29/20 11:32:57] [DEBUG] mysql_tquery(1, "", "OnPlayerRegister", "d")
[04/29/20 11:32:57] [DEBUG] CCallback::Create(amx=0x8303c00, name='OnPlayerRegister', format='d', params=0xf5a0d4f0, param_offset=5)
[04/29/20 11:32:57] [DEBUG] CCallback::Create - callback index for 'OnPlayerRegister': 9
[04/29/20 11:32:57] [DEBUG] processing specifier 'd' with parameter index 0
[04/29/20 11:32:57] [DEBUG] retrieved and pushed value '0'
[04/29/20 11:32:57] [INFO] Callback 'OnPlayerRegister' set up for delayed execution.
[04/29/20 11:32:57] [DEBUG] created delayed callback with 1 parameter
[04/29/20 11:32:57] [DEBUG] CHandle::Execute(this=0x8305a98, type=1, query=0x83299bc)
[04/29/20 11:32:57] [DEBUG] CHandle::Execute - return value: true
[04/29/20 11:32:57] [DEBUG] mysql_tquery: return value: '1'
[04/29/20 11:32:57] [DEBUG] CConnection::Execute(query=0x83299bc, this=0xf5504008, connection=0x831a8a0)
[04/29/20 11:32:57] [DEBUG] CQuery::Execute(this=0x83299bc, connection=0x831a8a0)
[04/29/20 11:32:57] [ERROR] error #1065 while executing query "": Query was empty
[04/29/20 11:32:57] [DEBUG] CConnection::GetError(this=0xf5504008, connection=0x831a8a0)
[04/29/20 11:32:57] [DEBUG] CCallback::Create(amx=0x8303c00, name='OnQueryError', format='dsssd)
[04/29/20 11:32:57] [DEBUG] CCallback::Create - callback index for 'OnQueryError': -10047
[04/29/20 11:32:57] [DEBUG] processing specifier 'd'
[04/29/20 11:32:57] [DEBUG] retrieved and pushed value '1065'
[04/29/20 11:32:57] [DEBUG] processing specifier 's'
[04/29/20 11:32:57] [DEBUG] retrieved and pushed value 'Query was empty'
[04/29/20 11:32:57] [DEBUG] processing specifier 's'
[04/29/20 11:32:57] [DEBUG] retrieved and pushed value 'OnPlayerRegister'
[04/29/20 11:32:57] [DEBUG] processing specifier 's'
[04/29/20 11:32:57] [DEBUG] retrieved and pushed value ''
[04/29/20 11:32:57] [DEBUG] processing specifier 'd'
[04/29/20 11:32:57] [DEBUG] retrieved and pushed value '1'
[04/29/20 11:32:57] [INFO] Callback 'OnQueryError' set up for delayed execution.
[04/29/20 11:32:57] [DEBUG] created delayed callback with 5 parameters
[04/29/20 11:32:57] [DEBUG] CCallback::Execute(amx=0x8303c00, index=-10047, num_params=5)
[04/29/20 11:32:57] [INFO] Executing callback 'ŮW' with 5 parameters...
[04/29/20 11:32:57] [DEBUG] processing internal specifier 'c'
[04/29/20 11:32:57] [DEBUG] pushed value '1' onto AMX stack
[04/29/20 11:32:57] [DEBUG] processing internal specifier 's'
[04/29/20 11:32:57] [DEBUG] pushed value '' onto AMX stack
[04/29/20 11:32:57] [DEBUG] processing internal specifier 's'
[04/29/20 11:32:57] [DEBUG] pushed value 'OnPlayerRegister' onto AMX stack
[04/29/20 11:32:57] [DEBUG] processing internal specifier 's'
[04/29/20 11:32:57] [DEBUG] pushed value 'Query was empty' onto AMX stack
[04/29/20 11:32:57] [DEBUG] processing internal specifier 'c'
[04/29/20 11:32:57] [DEBUG] pushed value '1065' onto AMX stack
[04/29/20 11:32:57] [DEBUG] executing AMX callback with index '-10047'
[04/29/20 11:32:57] [DEBUG] AMX callback executed with error '0'
[04/29/20 11:32:57] [INFO] Callback successfully executed.
[04/29/20 11:33:00] [DEBUG] mysql_format(1, 0xF5A0D500, 225, "UPDATE `PLAYERS` SET `MONEY` = '%d', `HEALTH` = '%f', `ARMOR` = '%f', `XPOS` = '%f', `YPOS` = '%f', `ZPOS` = '%f', `ANGLE` = '%f', `INTERIOR` = '%d', `VW` = '%d' WHERE `ID` = '%d') ")
[04/29/20 11:33:00] [DEBUG] mysql_format: return value: '213'
[04/29/20 11:33:00] [DEBUG] mysql_tquery(1, "UPDATE `PLAYERS` SET `MONEY` = '0', `HEALTH` = '0.000000', `ARMOR` = '0.000000', `XPOS` = '0.000000', `YPOS` = '0.000000', `ZPOS` = '0.000000', `ANGLE` = '0.000000', `INTERIOR` = '0', `VW` = '0' WHERE `ID` = '0') ", "", "")
[04/29/20 11:33:00] [DEBUG] CCallback::Create(amx=0x8303c00, name='', format='', params=0xf5a0d4ec, param_offset=5)
[04/29/20 11:33:00] [DEBUG] CHandle::Execute(this=0x8305a98, type=1, query=0x8329d3c)
[04/29/20 11:33:00] [DEBUG] CHandle::Execute - return value: true
[04/29/20 11:33:00] [DEBUG] mysql_tquery: return value: '1'
[04/29/20 11:33:00] [DEBUG] cache_is_valid(0)
[04/29/20 11:33:00] [DEBUG] cache_is_valid: return value: 'false'
[04/29/20 11:33:00] [DEBUG] CConnection::Execute(query=0x8329d3c, this=0xf5504008, connection=0x831a8a0)
[04/29/20 11:33:00] [DEBUG] CQuery::Execute(this=0x8329d3c, connection=0x831a8a0)
[04/29/20 11:33:00] [ERROR] error #1064 while executing query "UPDATE `PLAYERS` SET `MONEY` = '0', `HEALTH` = '0.000000', `ARMOR` = '0.000000', `XPOS` = '0.000000', `YPOS` = '0.000000', `ZPOS` = '0.000000', `ANGLE` = '0.000000', `INTERIOR` = '0', `VW` = '0' WHERE `ID` = '0') ": You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1
[04/29/20 11:33:00] [DEBUG] CConnection::GetError(this=0xf5504008, connection=0x831a8a0)
[04/29/20 11:33:00] [DEBUG] CCallback::Create(amx=0x8303c00, name='OnQueryError', format='dsssd)
[04/29/20 11:33:00] [DEBUG] CCallback::Create - callback index for 'OnQueryError': -10047
[04/29/20 11:33:00] [DEBUG] processing specifier 'd'
[04/29/20 11:33:00] [DEBUG] retrieved and pushed value '1064'
[04/29/20 11:33:00] [DEBUG] processing specifier 's'
[04/29/20 11:33:00] [DEBUG] retrieved and pushed value 'You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1'
[04/29/20 11:33:00] [DEBUG] processing specifier 's'
[04/29/20 11:33:00] [DEBUG] retrieved and pushed value ''
[04/29/20 11:33:00] [DEBUG] processing specifier 's'
[04/29/20 11:33:00] [DEBUG] retrieved and pushed value 'UPDATE `PLAYERS` SET `MONEY` = '0', `HEALTH` = '0.000000', `ARMOR` = '0.000000', `XPOS` = '0.000000', `YPOS` = '0.000000', `ZPOS` = '0.000000', `ANGLE` = '0.000000', `INTERIOR` = '0', `VW` = '0' WHERE `ID` = '0') '
[04/29/20 11:33:00] [DEBUG] processing specifier 'd'
[04/29/20 11:33:00] [DEBUG] retrieved and pushed value '1'
[04/29/20 11:33:00] [INFO] Callback 'OnQueryError' set up for delayed execution.
[04/29/20 11:33:00] [DEBUG] created delayed callback with 5 parameters
[04/29/20 11:33:00] [DEBUG] CCallback::Execute(amx=0x8303c00, index=-10047, num_params=5)
[04/29/20 11:33:00] [INFO] Executing callback 'ŮW' with 5 parameters...
[04/29/20 11:33:00] [DEBUG] processing internal specifier 'c'
[04/29/20 11:33:00] [DEBUG] pushed value '1' onto AMX stack
[04/29/20 11:33:00] [DEBUG] processing internal specifier 's'
[04/29/20 11:33:00] [DEBUG] pushed value 'UPDATE `PLAYERS` SET `MONEY` = '0', `HEALTH` = '0.000000', `ARMOR` = '0.000000', `XPOS` = '0.000000', `YPOS` = '0.000000', `ZPOS` = '0.000000', `ANGLE` = '0.000000', `INTERIOR` = '0', `VW` = '0' WHERE `ID` = '0') ' onto AMX stack
[04/29/20 11:33:00] [DEBUG] processing internal specifier 's'
[04/29/20 11:33:00] [DEBUG] pushed value '' onto AMX stack
[04/29/20 11:33:00] [DEBUG] processing internal specifier 's'
[04/29/20 11:33:00] [DEBUG] pushed value 'You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1' onto AMX stack
[04/29/20 11:33:00] [DEBUG] processing internal specifier 'c'
[04/29/20 11:33:00] [DEBUG] pushed value '1064' onto AMX stack
[04/29/20 11:33:00] [DEBUG] executing AMX callback with index '-10047'
[04/29/20 11:33:00] [DEBUG] AMX callback executed with error '0'
[04/29/20 11:33:00] [INFO] Callback successfully executed.
I guess the size should be even larger than 225?
Yes, that was one of the errors.
__________________
Developer @ Trucknation
"Never tell people how to do things. Tell them what to do and they will surprise you with their ingenuity"


IMPORTANT LINKS
An upcoming mix of trucking & light roleplay
Proxus is online now   Reply With Quote
Old 29/04/2020, 09:38 AM   #10
Mike861
Huge Clucker
 
Join Date: Feb 2018
Posts: 233
Reputation: 16
Default Re: mysql not saving players data

Quote:
Originally Posted by Proxus View Post
Yes, that was one of the errors.
That doesn't fix it, still nothing. But i saw this.

Code:
[04/29/20 11:38:08] [ERROR] error #1064 while executing query "UPDATE `PLAYERS` SET `MONEY` = '0', `HEALTH` = '0.000000', `ARMOR` = '0.000000', `XPOS` = '0.000000', `YPOS` = '0.000000', `ZPOS` = '0.000000', `ANGLE` = '0.000000', `INTERIOR` = '0', `VW` = '0' WHERE `ID` = '0') ": You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1
Mike861 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL not saving data Magic_Time Scripting Help 0 10/08/2015 04:00 AM
Saving players health data Arastair Scripting Help 2 07/02/2015 03:22 AM
MySQL saving Data yanir3 Scripting Help 5 24/06/2013 07:27 PM
MYSQL, saving players data. Richie© Scripting Help 4 19/06/2013 07:07 PM
Mysql Saving Data Stefand Scripting Help 7 07/05/2013 10:42 AM


All times are GMT. The time now is 04:15 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.