What potential security issue is highlighted in this forum thread related to PHP usage?

The potential security issue highlighted in this forum thread is the use of user input directly in SQL queries without proper sanitization, which can lead to SQL injection attacks. To solve this issue, it is recommended to use prepared statements with parameterized queries to securely handle user input.

// Using prepared statements to prevent SQL injection
$stmt = $pdo->prepare("SELECT * FROM users WHERE username = :username");
$stmt->bindParam(':username', $username);
$stmt->execute();