Create a PHP file to access your MySQLdatabase Create a PHP file and save it as guitar_list.php
Fantastic news! We've Found the answer you've been seeking!
Question:
Create a PHP file to access your MySQL database
- Create a PHP file and save it as guitar_list.php. (2) (3)
- Set the HTML title element for your new page to be Product Listing: Guitars.
- Add an HTML comment at the top of the page which includes your name, WEB182, the date, and the file name.
- Add an HTML level 1 heading ( h1) - Product Listing: Guitars - to the page.
- Using Figure 4-1 from the textbook (p. 127) as a guide, add PHP code to your file which will:
- Connect to your database (1) (4)
- Using Figure 4-2 from the textbook (p. 129) as a guide, add PHP code to your file which will:
- Use a try/catch statement to handle a PDO exception and display an error message.
- Using Figure 4-5 from the textbook (p. 135) as a guide, add PHP code to your file which will:
- Select fields from the gtr_shop1_products table for all items with a categoryID equal to 1.
- Use a foreach loop to display the following field values in an HTML table (include table headings) (3)
-
-
- productID
- productCode
- productName
- listPrice
-
Posted Date: