Example output

Information

  • You are given two tables of information: customers, addresses
    • See the table at right for details on the table structure
  • A customer may have addresses associated to them, or not.
  • A customer is linked to an address via the address' addr_cust field.
  • Example: Black,Jack is cust_id = 4. There are no addresses with addr_cust = 4
  • Example: Smith,John is cust_id = 2. There are two addresses with addr_cust = 2. Those belong to him.

  • Your mission is as follows, and I recommend the following order:
    • Create a page that simply lists the customers from the 'customers' table
    • Create another page that simply lists the address from the 'addresses' table
    • Create a combined page that pulls all the customer data, but also checks to see if they have any addresses
customers table
+------------+--------------+
| Field      | Type         |
+------------+--------------+
| cust_id    | int(11)      |
| cust_lname | varchar(255) |
| cust_fname | varchar(255) |
+------------+--------------+

addresses table
+--------------+--------------+
| Field        | Type         |
+--------------+--------------+
| addr_id      | int(11)      |
| addr_cust    | int(11)      |
| addr_desc    | varchar(255) |
| addr_street  | varchar(255) |
| addr_city    | varchar(255) |
| addr_prov    | varchar(10)  |
| addr_postal  | varchar(10)  |
+--------------+--------------+