Using PDO Prepared Statement and Incrementing a column value

$sql="UPDATE user_alerts SET notif = notif + 2 WHERE ( user_id = :userid )";
$prepStatement = $pdo->prepare( $sql );
$prepStatement->execute(array(':userid' => $userid));

You can’t bind a column name to a prepared statement.

Leave a Comment