What are potential pitfalls when using multiple OR conditions in a MySQL query within PHP?

When using multiple OR conditions in a MySQL query within PHP, a potential pitfall is the risk of SQL injection if the input values are not properly sanitized. To solve this issue, it is important to use prepared statements with bound parameters to prevent SQL injection attacks.

// Example of using prepared statements with bound parameters to avoid SQL injection
$stmt = $pdo->prepare("SELECT * FROM users WHERE username = :username OR email = :email");
$stmt->bindParam(':username', $username, PDO::PARAM_STR);
$stmt->bindParam(':email', $email, PDO::PARAM_STR);
$stmt->execute();