Question: The following will be based on your practice database, that you created during week 2 . After reading instructions, complete required steps: 1 . Create

The following will be based on your practice database, that you created during week 2. After reading instructions, complete required steps:
1. Create a file called index.php that will act as the entry point for our application. This file should:
- Establish a database connection to the practice database on localhost.
- Determine which controller to load based on the request URL.
- Call the appropriate method on the controller based on the request URL.
- Output the result of the method to the browser.
2. Create a file called controllers/list_customers.php. This file should:
- Define a function called list_customers() that retrieves all customers from the customers table and returns them as an array.
- Load the views/list_customers.php file and pass the array of customers to it.
3. Create a file called controllers/add_customer.php. This file should:
- Define a function called add_customer() that retrieves the customer data from the POST request and inserts it into the customers table.
- Redirect the user to the list_customers.php page.
4. Create a file called views/list_customers.php. This file should:
- Loop through the array of customers passed to it and display their information in a table.
5. Create a file called views/add_customer.php. This file should:
- Display a form that allows the user to enter the customer's information and submit it to the add_customer() function in the controllers/add_customer.php file.
 The following will be based on your practice database, that you

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!