COM372X—Programming assignment, week 7
(given 3/5 | due 3/12)
Assignment 7: Building a Back End
Purpose To build a PHP-MySQL back end to add, modify, or delete records to a database
The assignment: Although we designed the Book-O-Rama database using phpMyAdmin, populating and ten managing a database through phpMyAdmin would be slow and difficult. Here, we'll build the back end to the database, where an administrator (or a user) can directly access records in the database, to add new records, delete existing records, or to modify existing records.
At the same time, we'll finish the front end by allowing users to write orders via a front-end form.
- There needs to be a form for new customers to self-register, i.e., access to the customers table.This form needs inputs for name (first and last), address (number, street name), and city. If you designed the customers table without unique fields for first and last names (i.e., you foolishly followed the book's example of having a single field for customer name), add these fields and populate them now.
- To use the site, the user will have to be able to assemble orders. We have already made this form, but now you need to write a confirmed order into the orders table.
- The database contains a table that holds user-authored book reviews (ISBN, review). Make this table accessible to users through a front-end form.
For the back-end, you'll want to be able to add records for books and reviews, and to delete records from any table.
- You will need a form to enter books into the books table, including ISBN, author (last name, first name), title, and price.
Finally, you will want to be able to delete records from the books tables. Create a select list for each (2 forms), deleting books one at a time. Be sure to also delete any book reviews for books you no longer carry. (Question: Do you think you should also have a delete form for customers and their orders? Why or why not?)
Checklist:
- 1 Form for customers to register (adding a record to customers)
- 2 Order form (adding a record to orders)
- 3 Review form (adding a record to book reviews)
- 4 Backend form to add books to book table.
- 5 Backend form to delete books from books and reviews table.