Can't notice the problem
#1

pawn Код:
format(largestr, sizeof(largestr), "INSERT INTO `vehicles` (\
                `id`, `model`, `posX`, `posY`, `posZ`, `posAngle`, `interior`, `world`, `color1`, `color2`, `owner`, `locked`, `price`) VALUES(\
                %d, %d, %f, %f, %f, %f, %d, %d, %d, %d, '%s', 0, 0"
,
                GetVehicleFreeID(), VE[v][model], VE[v][posX], VE[v][posY], VE[v][posZ], VE[v][posAngle], VE[v][interior], VE[v][world], VE[v][color1], VE[v][color2], VE[v][owner]
            );
            mysql_query(largestr);
PHP код:
CMySQLHandler::Query(INSERT INTO `vehicles` (`id`, `model`, `posX`, `posY`, `posZ`, `posAngle`, `interior`, `world`, `color1`, `color2`, `owner`, `locked`, `price`) VALUES(0402, -131.4237821097.00329519.593750310.2520440001'Government'00) - An error has occured. (Error ID1064You have an error in your SQL syntaxcheck the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
What might be the problem?
Reply
#2

Do the values need to be encased in ''?
Reply
#3

Quote:
Originally Posted by MP2
Посмотреть сообщение
Do the values need to be encased in ''?
What do you mean?
Reply
#4

Quote:
Originally Posted by MP2
Посмотреть сообщение
Do the values need to be encased in ''?
No, string needs to be encased in '
Reply
#5

I wrap every value in quotes and it has always worked flawlessly. It's worth a try.
Edit: nevermind that, I see what the problem is. You forgot to close the brace at the end of your query. VALUES has no closing brace.
Reply
#6

Quote:
Originally Posted by Vince
Посмотреть сообщение
I wrap every value in quotes and it has always worked flawlessly. It's worth a try.
Edit: nevermind that, I see what the problem is. You forgot to close the brace at the end of your query. VALUES has no closing brace.
Aaaah yeah!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)