[MySQL] Syntax error, what?
#1

Strange thing right here, this is what it says in the logs:

Quote:

[23:26:53] CMySQLHandler::Query(UPDATE rpg_houses SET Int='6',Vir='0',Class='1',Price='0',Locked='1',Bou ght='0',Owner='0',Used='0' WHERE ID='0') - 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 'Int='6',Vir='0',Class='1',Price='0',Locked='1',Bo ught='0',Owner='0',Used='0' WHE' at line 1)

I don't see what's wrong?
Reply
#2

You don't have to use ' if you're setting numbers. You can just do:
Code:
SET Int = 6, Vir = 0
etc.
Reply
#3

Here is a suggestion for correcting query syntax - remember that all or none of these things may help, and that some of these things may not be needed, but on the other hand, they may fix your error.

I assume your Bought field doesn't have the space in it ( Bo ught )
try putting the database and table name in the query, and use those funny half quote things.
try adding spaces after your field names, before the = sign.
try the query with and without the punctuation around the field values (despite marcels post above)
pawn Code:
UPDATE `database`.`table` SET `Int`= 6, `Vir` = 0 WHERE ...
Really you should be trying all these things yourself before posting on forums for help, but good luck anyway.
Reply
#4

Quote:
Originally Posted by Rachael
View Post
Here is a suggestion for correcting query syntax - remember that all or none of these things may help, and that some of these things may not be needed, but on the other hand, they may fix your error.

I assume your Bought field doesn't have the space in it ( Bo ught )
try putting the database and table name in the query, and use those funny half quote things.
try adding spaces after your field names, before the = sign.
try the query with and without the punctuation around the field values (despite marcels post above)
pawn Code:
UPDATE `database`.`table` SET `Int`= 6, `Vir` = 0 WHERE ...
Really you should be trying all these things yourself before posting on forums for help, but good luck anyway.
I've already tried all those, i use this way of scripting for about 2 years now no problem.
And somehow this forum created a space beween "bought", but in the logs and in the script it isn't there.
Reply
#5

I think that string is too small. Try to make it bigger. It cutted out all that after WHE.
Reply
#6

Quote:
Originally Posted by silvis123
View Post
I think that string is too small. Try to make it bigger. It cutted out all that after WHE.
You can see, that in the first place it prints the query 100%, so the string is big enough, only the part where it prints the part of the problem is not fully.
Reply
#7

if you use phpmyadmin, just keep trying variations of the query until you don't get an error.
If you have been using the same query syntax for 2 years, I guess you should be looking at whatever has changed inbetween then and now.
Reply
#8

Post the query
Reply
#9

Quote:
Originally Posted by Rachael
View Post
if you use phpmyadmin, just keep trying variations of the query until you don't get an error.
If you have been using the same query syntax for 2 years, I guess you should be looking at whatever has changed inbetween then and now.
No i mean, i use the same methode for over 2 years, ofcourse the query's are different.
Reply
#10

Quote:
Originally Posted by Marcel
View Post
You don't have to use ' if you're setting numbers. You can just do:
Code:
SET Int = 6, Vir = 0
etc.
....
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)