strange mysql error - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: strange mysql error (
/showthread.php?tid=650005)
strange mysql error -
Score - 18.02.2018
Hello, i am getting an error when i am registering ingame.
Here is the code:
PHP код:
[15:51:40] [ERROR] error #1064 while executing query "UPDATE `players` SET `SCORE` = 0, `CASH` = 0, `KILLS` = 0, `DEATHS` = 0, `BAN` = 0, `ADMIN` = 0, `SKIN` = 0, WHERE `ID` = 4 LIMIT 1": 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 'WHERE `ID` = 4 LIMIT 1' at line 1
[15:51:40] [DEBUG] CConnection::GetError(this=0x4d3c020, connection=0x292ff0)
[15:51:40] [DEBUG] CCallback::Create(amx=0x27e12e0, name='OnQueryError', format='dsssd)
PHP код:
ALTER TABLE `players` ADD `ID` INT(12) NOT NULL AUTO_INCREMENT FIRST, ADD PRIMARY KEY (`ID`);
Re: strange mysql error -
DelK - 18.02.2018
Remove this comma `SKIN` = 0
,
Re: strange mysql error -
Score - 18.02.2018
Quote:
Originally Posted by DelK
Remove this comma `SKIN` = 0,
|
Thanks! I didn't even notice that
Re: strange mysql error -
Sithis - 21.02.2018
Also, the LIMIT 1 statement in your UPDATE query will only limit the rowcount returned from the query. Therefore, I suggest removing it.