Computer Science 390 – PHP Chapter 9 Lab 2

Objective: Access a MySQL database using a PHP program.

·         Read through the second part of Chapter 9 starting with the section on Ensuring Secure SQL to the end of the Chapter until you understand all of the PHP in the Code Scripts.

·         We will use the banking database that you created for last week’s assignment. 

·         The schema and relationships diagram for the banking database are at this link.

·         Execute SQL commands from a PHP form to show (in a nicely formatted html table):

1.      Show the first and last names of each customer and the account_id, type and balance for each account sorted by last name.

2.      For each customer show customer_id, last_name, first_name, account_id, type, balance, transaction_id, to_account_id, from_account_id, amount, and date_entered for each account that had money transferred into it.

3.      For each customer show customer_id, last_name, first_name, account_id, type, balance, transaction_id, to_account_id, from_account_id, amount, and date_entered for each account that had money transferred from it.

4.      For each account, all of the transactions from which money was transferred into the account and the total amount transferred (for each account and the total transferred among all accounts).

5.      For each account, all of the transactions from which money was transferred from the account and the total amount transferred (for each account and the total transferred among all accounts).

·         Submit your PHP programs to the Moodle link for this assignment.