MySQL update error
#1

Hey guys!

I don't know what is wrong with this:

Код:
mysql_query("UPDATE Characters SET Level = 5, Respect = 0, NRespect = 4, Skin = 15, Cash = 400, Bank = 55000, Job = 1, Leader = 1, Group = 1, Rank = 1, House = 1, RHouse = 1, Car = 1, MBike = 1, Bike = 1 WHERE Username = 'John' AND Chara = 0");
It gives this error:

Код:
CMySQLHandler::Query(UPDATE Characters SET Level = 5, Respect = 0, NRespect = 4, Skin = 15, Cash = 400, Bank = 55000, Job = 1, Leader = 1, Group = 1, Rank = 1, House = 1, RHouse = 1, Car = 1, MBike = 1, Bike = 1 WHERE Username = 'John' AND Chara = 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 'Group = 1, Rank = 1, House = 1, RHouse = 1, Car = 1, MBike = 1, Bike = 1 WHERE U' at line 1)
Reply
#2

I dont know alot about SQL but shouldnt it be SELECT * ... FROM .... WHERE ... etc etc
Reply
#3

No, it shouldn't. Because I want to update the row that already exists.
Reply
#4

As far as I can remember back to my SQL Days. 1064 is a Table Insertation error.... Meaning you have a problem inserting a table/row or instering into an actuall table that exists.
Reply
#5

You didn't even read "CMySQLHandler::Query(.." till the end. Shame on you that you ask questions that log already answers you.
Reply
#6

Yes, I have.

Код:
CMySQLHandler::Query(UPDATE Characters SET Level = 5, Respect = 0, NRespect = 4, Skin = 15, Cash = 400, Bank = 55000, Job = 1, Leader = 1, Group = 1, Rank = 1, House = 1, RHouse = 1, Car = 1, MBike = 1, Bike = 1 WHERE Username = 'John' AND Chara = 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 'Group = 1, Rank = 1, House = 1, RHouse = 1, Car = 1, MBike = 1, Bike = 1 WHERE U' at line 1)
And I don't see the mistake. Can you tell me what's wrong?
Reply
#7

pawn Код:
mysql_query("UPDATE `Characters` SET `Level` = 5, `Respect` = 0, `NRespect` = 4, `Skin` = 15, `Cash` = 400, `Bank` = 55000, `Job` = 1, `Leader` = 1, `Group` = 1, `Rank` = 1, `House` = 1, `RHouse` = 1, `Car` = 1, `MBike` = 1, `Bike` = 1 WHERE `Username` = 'John' AND `Chara` = 0");
try this
Reply
#8

Thanks, dude. It works.
Reply
#9

Something wrong here?
Код:
Bike = 1 WHERE U' at line 1)
Reply
#10

`Bike` and not Bike
the `s are necessary and important
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)