MySQL doesn't update table?
#7

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
You have to separate the fields it's going to update by a comma:
pawn Код:
"... SET `AdminLevel`=%d, `SavePos`=%d, `SavePosX`=%f, `SavePosY`=%f, `SavePosZ`=%f, ..."
and no need to use ` ` around fields' or table's name and neither ' ' around integers or float; although it's a must in strings.
Still, I'm getting the same error:
pawn Код:
mysql_format(mysql, query, sizeof query, "UPDATE `players` SET `AdminLevel`=%d, `SavePos`=%d,, `SavePosX`=%f, `SavePosY`=%f, `SavePosZ`=%f, `SavePosA`=%f, `SavePosInterior`=%d, `SavePosVW`=%d, `Kills`=%d, `Deaths`=%d, \
                    `Score`=%d, `Money`=%d WHERE `ID`=%d"
, pData[playerid][p_AdminLevel], pData[playerid][p_SavePos], tmpX, tmpY, tmpZ, tmpA,
                    pData[playerid][p_SavePosInterior], pData[playerid][p_SavePosVW], pData[playerid][p_Kills], pData[playerid][p_Deaths], GetPlayerScore(playerid), GetPlayerMoney(playerid), pData[playerid][p_ID]);
The error:
Quote:

[17:48:13] [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 ' `SavePosX`=1955.152, `SavePosY`=1367.763, `SavePosZ`=9.258, `SavePosA`=3.203, `' at line 1
It's strange that the error is only pointing at the floats part... Are you sure there is no need to use ' ' around them?
Reply


Messages In This Thread
MySQL doesn't update table? - by [XST]O_x - 22.06.2015, 13:52
Re: MySQL doesn't update table? - by X337 - 22.06.2015, 13:58
Re: MySQL doesn't update table? - by [XST]O_x - 22.06.2015, 14:03
Re: MySQL doesn't update table? - by mamorunl - 22.06.2015, 14:17
Re: MySQL doesn't update table? - by [XST]O_x - 22.06.2015, 14:22
Re: MySQL doesn't update table? - by Konstantinos - 22.06.2015, 14:44
Re: MySQL doesn't update table? - by [XST]O_x - 22.06.2015, 14:50
Re: MySQL doesn't update table? - by zPain - 22.06.2015, 15:03
Re: MySQL doesn't update table? - by [XST]O_x - 22.06.2015, 15:07

Forum Jump:


Users browsing this thread: 2 Guest(s)