update pdo php example
Example 1: update pdo mysql php
$sql = "UPDATE users SET name=?, surname=?, sex=? WHERE id=?";$stmt= $pdo->prepare($sql);$stmt->execute([$name, $surname, $sex, $id]);
Example 2: update pdo mysql php
$sql = "UPDATE users SET name=?, surname=?, sex=? WHERE id=?";$pdo->prepare($sql)->execute([$name, $surname, $sex, $id]);