mysql syntax prob
#1

Код:
      format(string, 200, "INSERT INTO vehicles (`Model`,`vPos`,` vPos2`, `vPos3`, `vPos4`, `color1`, `color2`, `price`, `rent`, `buyable`, `faction`, `crew`, `job`, `fuel`) VALUES('%i', '%f', '%f', '%f', '%f', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i')",
	  model, x, y, z, a, color1, color2, price, rent, buyable, faction, crew, job, 100);
Код:
[15:32:26] CMySQLHandler::Query(INSERT INTO vehicles (`Model`,`vPos`,` vPos2`, `vPos3`, `vPos4`, `color1`, `color2`, `price`, `rent`, `buyable`, `faction`, `crew`, `job`, `fuel`) VALUES('411', '2795.434326', '-2398.064941', '15.401) - 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 ''15.401' at line 1)
I don't see anything wrong there
Reply
#2

Im not sure either mate... but a small tip ... use
pawn Код:
format(string, sizeof(string)
Its better to use sizeof() rather than putting a number in that parameter

EDIT:
sorry i couldnt help with the question though
Reply
#3

Thanks for the tip.
I fixed this anyways
Reply
#4

Ah good, what was the problem and what fixed it? (just so i know for future or anyone that comes across this thread with the same problem)
Reply
#5

I didn't saw the size i was formatting, so i formatted only 200 but the real string size is 512(for mysql queries) so the problem was format size..
Reply
#6

you forgot a ' at the end lol.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)