CS 199 Willamette University Spring, 2019
 
Programming in PHP, Databases with MySQL,
and Web Applications
 

Laboratory Exercise on Tables, SQL joins, PHP, and the Web

Overview: This laboratory exercise is the last of four labs that provides practice with processing that involves joining tables in a database.

Background

As preparation for this lab, be sure you have read pages 201-207 in the textbook.

Also, each step in this lab draws heavily on exercises in the recent labs on MySQL, JOINs, and PHP. Be sure to review those labs before tackling the work here!

Forms with MySQL, PHP, and the Web

  1. The Lab on Joining Two MySQL Tables presented a table of courses offered in computer science and mathematics at Willamette University in Spring 2019.

    1. Develop a form that asks a user to supply a program (either CS or MATH) and radio buttons for "100-level", "200-level", "300-level", "400-level", or "any level".
    2. Develop a response page that receives the user input from part a of this problem and returns:
      • a listing of the sections and instructors offered this semester by that program at that level ("any-level" should include all sections offered by the program), and
      • a count of the number of sections offered by the program at that level.
  2. The lab on JOINs and PHP expanded upon the first lab on joining tables, considering table groceries (individual items available for sale) and table groceryOrders (which of these items were desired in a customer order.) This problem expands that work.

    1. Develop a form that asks a customer for an order number and a percentage for a tip to the store for putting the order together.
    2. Develop a response page that
      • retrieves the amount ordered and all items desired from that order,
      • displays each item ordered, together with its description, cost per unit, amount request, and cost of item in the order,
      • calculates and prints the total cost of the order (before tip),
      • calculates and prints the amount of the tip, and
      • calculates and prints the total cost (including tip).

      The entire order information should appear on a nicely-formatted Web page.



created 20 February 2019
revised 25 February 2019
Valid HTML 4.01! Valid CSS!