What potential security risks are present in the provided PHP code for updating database records?

The provided PHP code is vulnerable to SQL injection attacks as it directly concatenates user input into the SQL query. To mitigate this risk, you should use prepared statements with parameterized queries to sanitize user input before executing the query.

// Update database records with prepared statements
$stmt = $pdo->prepare("UPDATE users SET email = :email WHERE id = :id");
$stmt->bindParam(':email', $email);
$stmt->bindParam(':id', $id);
$stmt->execute();