What potential issue can arise when handling user login credentials in PHP, as shown in the provided code snippet?

The potential issue that can arise when handling user login credentials in PHP is storing passwords in plain text, which is a significant security risk. To solve this issue, passwords should be hashed using a secure hashing algorithm like bcrypt before storing them in the database. This way, even if the database is compromised, the passwords will not be easily readable.

// Hashing the password before storing it in the database
$password = password_hash($_POST['password'], PASSWORD_BCRYPT);

// Storing the hashed password in the database
$stmt = $pdo->prepare("INSERT INTO users (username, password) VALUES (:username, :password)");
$stmt->bindParam(':username', $_POST['username']);
$stmt->bindParam(':password', $password);
$stmt->execute();