Team LiB
Previous Section Next Section

Creating the User Table

In Chapter 12, "Creating a Database Table," you followed a two-step table-creation process. You can use that same process to create the authorized users table.

  1. Open your web browser to http://127.0.0.1/show_createtable.html.

  2. In the Table Name field, type auth_users.

  3. In the Number of Fields field, type 4.

  4. Click on the Go to Step 2 button. You should see a form with four rows, corresponding to the four fields that will be in the auth_users table.

  5. In the first row, type f_name for the Field Name, select varchar from the Field Type drop-down menu, and specify a Field Length of 50. This field will hold the user's first name.

  6. In the second row, type l_name for the Field Name, select varchar from the Field Type drop-down menu, and specify a Field Length of 50. This field will hold the user's last name.

  7. In the third row, type username for the Field Name, select varchar from the Field Type drop-down menu, and specify a Field Length of 25. This field will hold the user's username.

  8. In the fourth row, type password for the Field Name, select varchar from the Field Type drop-down menu, and specify a Field Length of 100. This field will hold a hash of the password.

Note 

If you recall from Chapter 7, "Displaying Dynamic Content," a hash is like a digital summary of the string. It can be used to compare versions of strings (or files) to determine whether the versions differ.

The completed form should look like the following figure.

Click To expand

Click on the Create Table button. You should see a confirmation screen stating that your table has been created. In the next section, you create a record addition form and script, and add users to the auth_users table.


Team LiB
Previous Section Next Section