Results 1 to 2 of 2

Thread: Syntax error in UPDATE statement.

  1. #1
    Join Date
    Nov 2005
    Posts
    4

    Unhappy Syntax error in UPDATE statement.

    Hi-

    I am working on a simple database using coldfusion language. I am getting a syntax error on line 134. Can anyone see what the problem is?

    132 : SET Position='#Form.Position#',
    133 : Description='#Form.Description#' ,
    134 : Requirements='#Form.Requirements#'
    135 : WHERE JobID=2
    136 : </cfquery>

    Thanks,
    Dave

  2. #2
    Join Date
    Jan 2006
    Location
    Manchester England UK
    Posts
    225
    well there is no "UPDATE tablename" in what you have there but assuming you have this....

    What are your variable values and are they safe for direct SQL input like that?
    Not understanding PHP but assuming this is a fom request it could be that your input strings are unsafe. You should ALWAYS sanatise input strings or ideally use parameterised queries. Characters that usually cause problems are apostophies and semi colons.

    It could also be a reserved word. again not knowing php or mySQL I don't know if this will work but try enclosing Position and description in square brackets as these are the most likely offenders.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •