[MySQL] set some values, and leaves others at 0 - 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] set some values, and leaves others at 0 (
/showthread.php?tid=253779)
[MySQL] set some values, and leaves others at 0 -
Whitetiger - 07.05.2011
aight so i made this simple command to convert some DMs to mysql and basicly, its setting the majority of the values correctly, but it leaves the X, Y and Z positions at 0.
http://pastebin.com/8ne3QH1z
the MySQL log shows:
Quote:
[18:50:11] CMySQLHandler::Query(INSERT INTO `dms` ('Z13') VALUES (`4.382812`)) - An error has occured. (Error ID: 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 ''Z13') VALUES (`4.382812`)' at line 1)
|
and it spams that a couple times, but i've tried changing around the code a bit and sent it to a couple people and they don't see any problems.
/imageshack/img215/7221/helpd.jpg
Re: [MySQL] set some values, and leaves others at 0 -
(SF)Noobanatior - 07.05.2011
x y z are floats so it should be %f or %.2f for 2dp not %d which is for decimal
plus when you format the x y z you are passing the x var to all of them
Re: [MySQL] set some values, and leaves others at 0 -
Whitetiger - 08.05.2011
lower case x is the value in the loop, so it uses %d.. it printf's in the server log correctly, it is something in the query.
Re: [MySQL] set some values, and leaves others at 0 -
MadeMan - 08.05.2011
pawn Code:
INSERT INTO `dms` ('Z13') VALUES
Remove upper commas from Z13
pawn Code:
INSERT INTO `dms` (Z13) VALUES
Re: [MySQL] set some values, and leaves others at 0 -
DRIFT_HUNTER - 08.05.2011
(`4.382812`)) two brackets closing?