I'm trying to do a UPDATE query in php and I get a syntax error
Error: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WHERE id = '30'' at line 1
$sql = "UPDATE usuario SET nombre WHERE id = '$id_usuario'";
try {
$stmt = $conn->prepare($sql);
$result = $stmt->execute();
if ($result) {
echo "Ok";
}
} catch (PDOException $e) {
echo "Error: " . $e->getMessage();
die;
}
the error is in the $sql = ... line. Thanks!