Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Lab Exercise for CPSC 370K: Creating and Populating MySQL Databases, Lab Reports of Computer Science

Instructions for creating and populating mysql databases using the given sql statements and phpmyadmin. Students are required to execute sql queries to view user data and ship info, write php scripts to connect to the database and send emails, and create forms for password changes.

Typology: Lab Reports

Pre 2010

Uploaded on 08/19/2009

koofers-user-ozr
koofers-user-ozr 🇺🇸

10 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Lab for CPSC 370K
Use mysql on rosemary.mwc.edu to
Create the tables described in Figures 8.1 and 8.2 of the materials distributed about
databases.
The SQL you need to use is given on pages 5 and 6 of that material.
Use phpMyAdmin (http://rosemary.mwc.edu/phpMyAdmin) and the appropriate SQL to
insert data into the tables so that if we try SELECT * FROM users we see the following
entries
and if we use SELECT * FROM shipinfo we have three records in the table as follows:
What do you see when you execute
SELECT * FROM users ORDER BY user_name ?
What do you see when you execute
SELECT name, email, zip FROM shipinfo ORDER BY zip
pf3

Partial preview of the text

Download Lab Exercise for CPSC 370K: Creating and Populating MySQL Databases and more Lab Reports Computer Science in PDF only on Docsity!

Lab for CPSC 370K Use mysql on rosemary.mwc.edu to Create the tables described in Figures 8.1 and 8.2 of the materials distributed about databases. The SQL you need to use is given on pages 5 and 6 of that material. Use phpMyAdmin (http://rosemary.mwc.edu/phpMyAdmin) and the appropriate SQL to insert data into the tables so that if we try SELECT * FROM users we see the following entries and if we use SELECT * FROM shipinfo we have three records in the table as follows: What do you see when you execute SELECT * FROM users ORDER BY user_name? What do you see when you execute SELECT name, email, zip FROM shipinfo ORDER BY zip

Now write and execute the SQL necessary to display a list of user names from users in alphabetic order. Put the SQL statement here Now write and execute the SQL necessary to display the user name, real name, and phone number for all the entries in shipinfo. Put the SQl statement here Now we’re going to try some php scripts that connect to the MySQL database you’ve created. Login to rosemary.mwc.edu. Change to your directory public_html. Create the file named mydbinfo.php so it contains

Save the file and be sure it is readable by anyone. **Copy /users/ernie/public_html/lab1.php to your current directory.** See what http://rosemary.mwc.edu/~yourloginname/lab1.php produces. Substitute your login name on rosemary for yourloginname. **Copy /users/ernie/public_html/lab2.php to your current directory.** See what http://rosemary.mwc.edu/~yourloginname/lab1.php produces. Substitute your login name on rosemary for yourloginname. Now write a script lab3.php that sends an email to all the entries in shipinfo where the email contains the following “Dear _realname_ : Your password, _password_ , has been hacked by DarkBobo. Please reset your password as soon as we write a script to do that.” Substitute the entry in the name field of shipinfo for _realname_ and the user_password entry in the appropriate record of users for _password_. Before you access your script Put your mysql user name, password, and database name for these three entries