Results 1 to 3 of 3

Thread: puzzled...

  1. #1
    Join Date
    Apr 2005
    Posts
    46

    Unanswered: puzzled...

    I am trying to update a table through a form.
    I am posting the fied 'description' and trying to
    update it below. Everything works when I remove
    "desc = '$desc'", however I am getting a syntax
    error when I have it it.

    thoughts?


    Code:
    $description = $_POST["description"];
    $desc = strip_tags($description);
    
    
    $sql_comtup = "update ftp_job set
    		Lment = '$full_name',
    		CtDate = '$Date',
    		desc = '$desc'
    			where JobNum='$JobNum'";
    
    if (!(@mysql_query($sql_comtup, $conn)))
    {
    	showerror();
    }

  2. #2
    Join Date
    Oct 2002
    Location
    Plymouth UK
    Posts
    116
    Try echoing out the sql statement ($sql_comtup) and have look at what you are asking the database engine to process. If you can't find the syntax error, post the query echoed for us to help with.

  3. #3
    Join Date
    Apr 2005
    Posts
    46
    Ah, I found my mistake:

    The original code was:
    Code:
    update ftp_job set LastComment = 'test', CommentDate = '1152716673', desc = 'test' where JobNum='10002'
    apparently, there is some mySQL syntax for 'desc' and was expecting something else... by changing my column to something else (job_desc), the code worked fine:

    Code:
    update ftp_job set LastComment = 'Luke M. Vaillancourt', CommentDate = '1152716673', job_desc = 'test' where JobNum='10002'
    Thanks for the insight in problem solving!

Posting Permissions

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