What potential security risks are associated with storing passwords in a database without hashing?

Storing passwords in a database without hashing leaves them vulnerable to security breaches. If the database is compromised, all passwords can be easily accessed and used by attackers. To mitigate this risk, passwords should be hashed before storing them in the database. Hashing is a one-way encryption method that converts the password into a unique string of characters, making it difficult for attackers to reverse engineer the original password.

$hashed_password = password_hash($password, PASSWORD_DEFAULT);