Problem with MySQL saving.
#1

Hey! The problem is, when I save my character on server, doesn't updates all thing, even if in the mysql log says that executed successfully. So I show the code:
Code:
mysql_format(sql,q,sizeof(q),
	"UPDATE `characters` SET `Name`='%s', `Gender`='%d',`Skin`='%d' WHERE `ID`='%d'",CharInfo[characterid][name],CharInfo[characterid][gender],CharInfo[characterid][skin],characterid);
	mysql_query(sql,q,false);
	mysql_format(sql,q,sizeof(q),
	"UPDATE `characters` SET `LastEnter`='%s',`Ban`='%d',`Birth`='%s',`Radical`='%s',`Bank`='%d' WHERE `ID`='%d'",CharInfo[characterid][lastEnter],CharInfo[characterid][ban],CharInfo[characterid][birth],CharInfo[characterid][radical],CharInfo[characterid][bankMoney],characterid);
	mysql_query(sql,q,false);
	mysql_format(sql,q,sizeof(q),
	"UPDATE `characters` SET `Cash`='%d',`Level`='%d',`Job`='%d',`Faction`='%d',`AdminJail`='%d' WHERE `ID`='%d'",CharInfo[characterid][cash],CharInfo[characterid][level],CharInfo[characterid][bankMoney],CharInfo[characterid][job],CharInfo[characterid][faction],CharInfo[characterid][adminJail],characterid);
	mysql_query(sql,q,false);
And here's the MySQL log. For e.g The name, gender, lastenter changes, but the Cash no, remains the same in the database while in the log its correct.
Code:
[23:40:57] [DEBUG] mysql_format(1, 0x03F4BF44, 1024, "UPDATE `characters` SET `Name`='%s', `Gender`='%d',`Skin`='%d' WHERE `ID`='%d'")
[23:40:57] [DEBUG] mysql_format: return value: '87'
[23:40:57] [DEBUG] mysql_query(1, "UPDATE `characters` SET `Name`='James_Cartment', `Gender`='0',`Skin`='6' WHERE `ID`='1'", 0)
[23:40:57] [DEBUG] CHandle::Execute(this=0x5e0dd0, type=3, query=0x608dc0)
[23:40:57] [DEBUG] CConnection::Execute(query=0x608dc0, this=0x548a70, connection=0x599120)
[23:40:57] [DEBUG] CQuery::Execute(this=0x608dc0, connection=0x599120)
[23:40:57] [INFO] query "UPDATE `characters` SET `Name`='James_Cartment', `Gender`='0',`Skin`='6' WHERE `ID`='1'" successfully executed within 104.726 milliseconds
[23:40:57] [DEBUG] CResultSet::Create(connection=0x599120, query_str='UPDATE `characters` SET `Name`='James_Cartment', `Gender`='0',`Skin`='6' WHERE `ID`='1'')
[23:40:57] [DEBUG] created new resultset '0x555958'
[23:40:57] [DEBUG] fetched MySQL result '0x0'
[23:40:57] [DEBUG] CHandle::Execute - return value: true
[23:40:57] [DEBUG] mysql_query: return value: '0'
[23:40:57] [DEBUG] mysql_format(1, 0x03F4BF44, 1024, "UPDATE `characters` SET `LastEnter`='%s',`Ban`='%d',`Birth`='%s',`Radical`='%s',`Bank`='%d' WHERE `ID`='%d'")
[23:40:57] [DEBUG] mysql_format: return value: '125'
[23:40:57] [DEBUG] mysql_query(1, "UPDATE `characters` SET `LastEnter`='2020/2/15',`Ban`='0',`Birth`='1976/7/24',`Radical`='Mongoloid',`Bank`='0' WHERE `ID`='1'", 0)
[23:40:57] [DEBUG] CHandle::Execute(this=0x5e0dd0, type=3, query=0x608278)
[23:40:57] [DEBUG] CConnection::Execute(query=0x608278, this=0x548a70, connection=0x599120)
[23:40:57] [DEBUG] CQuery::Execute(this=0x608278, connection=0x599120)
[23:40:57] [INFO] query "UPDATE `characters` SET `LastEnter`='2020/2/15',`Ban`='0',`Birth`='1976/7/24',`Radical`='Mongoloid',`Bank`='0' WHERE `ID`='1'" successfully executed within 46.768 milliseconds
[23:40:57] [DEBUG] CResultSet::Create(connection=0x599120, query_str='UPDATE `characters` SET `LastEnter`='2020/2/15',`Ban`='0',`Birth`='1976/7/24',`Radical`='Mongoloid',`Bank`='0' WHERE `ID`='1'')
[23:40:57] [DEBUG] created new resultset '0x555bf8'
[23:40:57] [DEBUG] fetched MySQL result '0x0'
[23:40:57] [DEBUG] CHandle::Execute - return value: true
[23:40:57] [DEBUG] mysql_query: return value: '0'
[23:40:57] [DEBUG] mysql_format(1, 0x03F4BF44, 1024, "UPDATE `characters` SET `Cash`='%d',`Level`='%d',`Job`='%d',`Faction`='%d',`AdminJail`='%d' WHERE `ID`='%d'")
[23:40:57] [DEBUG] mysql_format: return value: '105'
[23:40:57] [DEBUG] mysql_query(1, "UPDATE `characters` SET `Cash`='50203',`Level`='0',`Job`='0',`Faction`='0',`AdminJail`='0' WHERE `ID`='0'", 0)
[23:40:57] [DEBUG] CHandle::Execute(this=0x5e0dd0, type=3, query=0x608440)
[23:40:57] [DEBUG] CConnection::Execute(query=0x608440, this=0x548a70, connection=0x599120)
[23:40:57] [DEBUG] CQuery::Execute(this=0x608440, connection=0x599120)
[23:40:57] [INFO] query "UPDATE `characters` SET `Cash`='50203',`Level`='0',`Job`='0',`Faction`='0',`AdminJail`='0' WHERE `ID`='0'" successfully executed within 46.790 milliseconds
[23:40:57] [DEBUG] CResultSet::Create(connection=0x599120, query_str='UPDATE `characters` SET `Cash`='50203',`Level`='0',`Job`='0',`Faction`='0',`AdminJail`='0' WHERE `ID`='0'')
[23:40:57] [DEBUG] created new resultset '0x61b550'
[23:40:57] [DEBUG] fetched MySQL result '0x0'
[23:40:57] [DEBUG] CHandle::Execute - return value: true
[23:40:57] [DEBUG] mysql_query: return value: '0'
[23:40:57] [DEBUG] mysql_errno(1)
[23:40:57] [DEBUG] CHandle::GetErrorId(this=0x5e0dd0)
[23:40:57] [DEBUG] CConnection::GetError(this=0x548a70, connection=0x599120)
[23:40:57] [DEBUG] CHandle::GetErrorId - return value: true, error id: '0', error msg: ''
[23:40:57] [DEBUG] mysql_errno: return value: '0'
Reply


Messages In This Thread
Problem with MySQL saving. - by Davi52 - 15.02.2020, 20:46
Re: Problem with MySQL saving. - by Unte99 - 15.02.2020, 21:58
Re: Problem with MySQL saving. - by Symon - 15.02.2020, 22:45
Re: Problem with MySQL saving. - by Davi52 - 16.02.2020, 07:26
Re: Problem with MySQL saving. - by Calisthenics - 16.02.2020, 09:37

Forum Jump:


Users browsing this thread: 1 Guest(s)