MYSQL Help (Small 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: MYSQL Help (Small Problem) (
/showthread.php?tid=243634)
MYSQL Help (Small Problem) -
Rokzlive - 23.03.2011
Im getting an syntax error for a sql line i made. Anyone plz help?
Error:
Код HTML:
[15:52:35] [MySQL] Error (0): Failed to exeute query. 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 '' at line 1.
Line:
pawn Код:
format(query, sizeof(query), "INSERT INTO `ownedcars` (`Model`, `Color1`, `Color2`, `Price`, `Owner`, `PosX`, `PosY`, `PosZ`, `PosA`, `Plate`) VALUES ('402', '0', '0', '0', '%s', '-1969.9641', '262.6344', '35.0036', '1.6208', '%s'));", pname, pname);
mysql_query(query);
Re: MYSQL Help (Small Problem) -
WackoX - 23.03.2011
Delete the last ");".
Re: MYSQL Help (Small Problem) - Unknown123 - 23.03.2011
try
pawn Код:
format(query, sizeof(query), "INSERT INTO `ownedcars` (`Model`, `Color1`, `Color2`, `Price`, `Owner`, `PosX`, `PosY`, `PosZ`, `PosA`, `Plate`) VALUES ('402', '0', '0', '0', '%s', '-1969.9641', '262.6344', '35.0036', '1.6208', '%s')", pname);
mysql_query(query);
or
pawn Код:
format(query, sizeof(query), "INSERT INTO `ownedcars` (Model, Color1, Color2, Price, Owner, PosX, PosY, PosZ, PosA, Plate) VALUES ('402', '0', '0', '0', '%s', '-1969.9641', '262.6344', '35.0036', '1.6208', '%s')", pname);
mysql_query(query);