3 responses to “PHP, MySQL Tutorial for Beginners – Updating Rows with PDO”

  1. Roland

    Excellent tutorial!
    One tiny mistake though:

    There are quotation marks missing, this is wrong:
    $query->execute( array ( :first_name => $new_first_name ) );

    This is right:
    $query->execute( array ( “:first_name” => $new_first_name ) );

    I think the same goes for updating multiple columns, but I haven’t tried that example.

  2. adam

    you should this is a right syntax?
    $sql = “UPDATE users SET first_name, surname VALUES :first_name, :surname “;

Leave a Reply