In PHP, what are the potential pitfalls of using numerical values versus character values in SQL queries for updates?

When using numerical values in SQL queries for updates, it is important to remember that SQL queries should be properly escaped to prevent SQL injection attacks. If numerical values are not properly sanitized, it can lead to vulnerabilities in the application. It is recommended to use prepared statements with placeholders for numerical values to prevent SQL injection attacks.

// Using prepared statements with placeholders for numerical values
$id = 1;
$newValue = 100;

$stmt = $pdo->prepare("UPDATE table SET column = :value WHERE id = :id");
$stmt->bindParam(':value', $newValue, PDO::PARAM_INT);
$stmt->bindParam(':id', $id, PDO::PARAM_INT);
$stmt->execute();