SA-MP Forums Archive
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: MySQL error (/showthread.php?tid=649151)



MySQL error - Ripster - 03.02.2018

Quote:

[23:10:01 02/03/18] [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 'Lock = 0, State = 0 WHERE DoorDBID = 2' at line 1 (Query: "UPDATE door SET OwnerDBID = 1, FactionDBID = 0, Model = 1537, Lock = 0, State = 0 WHERE DoorDBID = 2")

Код:
mysql_format(ourConnection, threadSave, sizeof(threadSave), "UPDATE door SET OwnerDBID = %i, FactionDBID = %i, Model = %i, Lock = %i, State = %i WHERE DoorDBID = %i",
		DoorInfo[id][OwnerID],
		DoorInfo[id][FactionID],
		DoorInfo[id][Model],
		DoorInfo[id][Lock],
		DoorInfo[id][State],
		DoorInfo[id][DoorID]);
	mysql_tquery(ourConnection, threadSave);



Re: MySQL error - Misiur - 03.02.2018

https://dev.mysql.com/doc/refman/5.7...5-7-detailed-L

I believe "Lock" is a reserved keyword. Try wrapping it in "`"


Re: MySQL error - Ripster - 04.02.2018

Quote:
Originally Posted by Misiur
Посмотреть сообщение
https://dev.mysql.com/doc/refman/5.7...5-7-detailed-L

I believe "Lock" is a reserved keyword. Try wrapping it in "`"
Yes, "Lock" was the problem. Thank you