Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

syntax error

Status
Not open for further replies.

Louth

Programmer
Jan 21, 2004
16
EU
Can somebody tell me why this statement keeps giving me an error? There seems to be a problem with the forward slash but even when I put it into quotes I am getting an error.

"UPDATE db_ulp SET trainees/trainee_add=0 WHERE user_id=2";
 
you need to escape those slashes with a backslash. Note that it is way better and easier to manage if you use underscores as seperators..

trainees_trainee

You can add a backslash here to escape the forward slash

"UPDATE db_ulp SET trainees\/trainee_add=0 WHERE user_id=2";


Bastien

Cat, the other other white meat
 
Cheers man but that's still not working. I can't figure out what the problem is. I've tried every possible way around it I can and I still can't figure it out
 
bastienk is right. Using a slash in a column-name is bad news.

But if you feel you must use that slash, try putting the name of the column in backticks:

UPDATE db_ulp SET `trainees/trainee_add`=0 WHERE user_id=2

[NOTE: that's backtick -- on the same key as the tilde on a standard US English keyboard]

Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top