[MySQL] set some values, and leaves others at 0
#1

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

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
Reply
#3

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.
Reply
#4

pawn Code:
INSERT INTO `dms` ('Z13') VALUES
Remove upper commas from Z13

pawn Code:
INSERT INTO `dms` (Z13) VALUES
Reply
#5

(`4.382812`)) two brackets closing?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)