You never store a password. You store a hash of it, and compare hashes later.
passwords.php
password_hash()
password_verify()
passwords_demo.php