What potential issues can arise when using PDO-SQL statements in PHP?

One potential issue when using PDO-SQL statements in PHP is SQL injection attacks if user input is not properly sanitized. To prevent this, always use prepared statements with bound parameters instead of directly inserting user input into the SQL query.

// Example of using prepared statements with bound parameters to prevent SQL injection
$pdo = new PDO("mysql:host=localhost;dbname=mydatabase", "username", "password");

$username = $_POST['username'];
$password = $_POST['password'];

$stmt = $pdo->prepare("SELECT * FROM users WHERE username = :username AND password = :password");
$stmt->bindParam(':username', $username);
$stmt->bindParam(':password', $password);
$stmt->execute();