19.3. Putting encrypted passwords in databases

19.3.1. Creating an encrypted password table in MySQL

If your Web site has a large number of members, storing encrypted passwords in a file may not be efficient and may be difficult to maintain. In this case, a good alternative is to consider putting all passwords into a database. Since we already have some experience on the database package MySQL, we will set up a password table in MySQL and use it to protect a page.

In fact, putting user or member passwords into a database can have all the benefits of a database application. For example, the following features can be easily added or implemented as SQL statements:

  • Search password for a particular user.

  • Set up new member accounts with password. ...

Get Practical Web Technologies now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.