SA-MP Forums Archive
Mysql syntax problem - 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 syntax problem (/showthread.php?tid=611548)



Mysql syntax problem - idontcareRO - 07.07.2016

Hello, today i started a new garage system with mysql saving, but when i create a garage with /makegarage command i have this error in mysql log:
Код HTML:
(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) VALUES (1858.509399, -1883.433715, 13.443518, 235.845504, 1653.058837, 189' at line 1
at this line:

Код:
format(query, sizeof(query), "INSERT INTO `garages` (x, y, z, ex, ey, ez, vw, price, owner, owned, lock) VALUES (%f, %f, %f, %f, %f, %f, %d, %d, 'Statul', 0, 0)",
    GarageInfo[garage][gEnterX],
    GarageInfo[garage][gEnterY],
    GarageInfo[garage][gEnterZ],
    GarageInfo[garage][gExitX],
    GarageInfo[garage][gExitY],
    GarageInfo[garage][gExitZ],
    GarageInfo[garage][gvw],
    GarageInfo[garage][gprice],
    GarageInfo[garage][gowner],
    GarageInfo[garage][gowned],
    GarageInfo[garage][glock]);
I can't find any error in mysql query. Any help?


Re: Mysql syntax problem - diego200052 - 07.07.2016

The variable query need more space in memory. How much memory currently have?


Re: Mysql syntax problem - Konstantinos - 07.07.2016

lock is a MySQL keyword for locking tables, use it as:
Код:
"INSERT INTO ... , owned, `lock`) VALUES ..."



Re: Mysql syntax problem - idontcareRO - 08.07.2016

Thanks Konstantinos !