How can the SQL syntax error mentioned in the forum thread be resolved for the UPDATE statement?

The SQL syntax error in the UPDATE statement can be resolved by ensuring that the column names and values are properly formatted and separated by commas. Additionally, make sure to use single quotes around string values.

<?php
// Assuming $conn is the database connection object
$sql = "UPDATE table_name SET column1 = 'value1', column2 = 'value2' WHERE condition";
if ($conn->query($sql) === TRUE) {
    echo "Record updated successfully";
} else {
    echo "Error updating record: " . $conn->error;
}
$conn->close();
?>