$sql = "UPDATE users SET name=?, surname=?, sex=? WHERE id=?";$stmt= $pdo->prepare($sql);$stmt->execute([$name, $surname, $sex, $id]);
$stmt = $pdo->prepare("UPDATE table SET column = ?");
$stmt->execute([$value]);
$sql = 'UPDATE publishers
SET name = :name
WHERE publisher_id = :publisher_id';
// prepare statement
$statement = $pdo->prepare($sql);
// bind params
$statement->bindParam(':publisher_id', $abc);
$statement->bindParam(':name', $abcd);
// execute the UPDATE statment
if ($statement->execute()) {
echo 'The record has been updated successfully!';
}
$sql = 'UPDATE publishers
SET name = :name
WHERE publisher_id = :publisher_id';
// prepare statement
$statement = $pdo->prepare($sql);
// bind params
$statement->bindParam(':publisher_id', $abc);
$statement->bindParam(':name', $abcd);
// execute the UPDATE statment
if ($statement->execute()) {
echo 'The record has been updated successfully!';
}
$sql = "UPDATE users SET name=?, surname=?, sex=? WHERE id=?";$pdo->prepare($sql)->execute([$name, $surname, $sex, $id]);