CISC4322  Lab8  (due: Thursday 3/29/07)

     This week we are going to Create a table for your Database, load it with data and access the data through a php script.

O.K., now to the assignment:

1. A database has already be created for you. You need to create a table inside the database. You can access your database, through your browser, using this link to "phpMyAdmin". You will need to use a "user_name" and "password" to access the MySQL database. Your username is the same as your login username and I will give out your MySQL password in class.

Once you have logged in, click on your database's name, mine is called "efa" - it is the same name as my username. Once you do, the following screen following screen will appear.

Once you have created the table "phone" add the fields "Lname" (Last Name), "Fname" (First Name), "Phone_no" (Phone number), and "index' (index will be the primary key). Here is the completed table (part1). Here is the completed table (part2).

2. Now that you have created a phone table, you will need to populate it with data. Create a text file, on your computer, one that contains 5 or more records. Mine looks like this "phoneData.txt". Don't use my data values, make your own. Don't use real phone numbers, as we will not be protecting this data. Also, make sure to leave one blank line at the bottom (the last line). Take note of the semi-colon ";" which separates each field.
Once again access your "MySQL" database through "phpMyAdmin" program. After you have logged in, click on your "table's name" and then click on [Import]. You will see an import form (part1) and import form (part2). Modify your form as in the example and browse to your text files location, click [go] to complete the import operation.

Now that you have imported the data, you might like to look at it, or maybe modify it. Click on the [browse] button and you will see a table something like mine.

3. Next I want you to add a file, "phone.php" to your other web-pages. You will need to modify the file with your own "username" and "password". Here is what my file looks like (phone.php). This page should have a link from your web experiments page. The linked page will act as the turn-in for this assignment.