frustrated with update query

Discussion in 'PHP' started by lilwing, Sep 1, 2007.

  1. #1
    so i have an update query, and i keep getting an error, i am not sure how to solve the problem.

    please post if you have a suggestion.

    the error:
    
    Error: 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 'SET pagecontent = '
    [div][h]Reynold J. Minnerath test[/h]
    
    ' at line 2
    Code (markup):
    the query:

    $sql = "UPDATE $table
    SET pagecontent = '" .bb2html($_POST['T']). "'
    WHERE id = " .$_POST['id2'];
    Code (markup):
     
    lilwing, Sep 1, 2007 IP
  2. webw

    webw Peon

    Messages:
    32
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Try this:

    $sql = "UPDATE `$table`
    SET pagecontent = '" .bb2html($_POST['T']). "'
    WHERE id = " .$_POST['id2'];
    Code (markup):
     
    webw, Sep 1, 2007 IP
  3. lilwing

    lilwing Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thanks :D

    i also had a few problems on other page, but it works now
     
    lilwing, Sep 1, 2007 IP