MYSQL Help (Small Problem)
#1

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);
Reply
#2

Delete the last ");".
Reply
#3

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);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)