Question
Create a folder. In this folder, have two files called index.php and viewProducts.php. Create a file called db_connect.php that establishes a connection to the database
Create a folder. In this folder, have two files calledindex.phpandviewProducts.php.
Create a file calleddb_connect.phpthat establishes a connection to the database as the root user. Include this file inindex.php, where you will be performing queries
InviewProducts.phpdisplay these under the sub-title Display using echo statements: Display the productID and productName using echo statements. Make sure to includeviewProducts.phpin theindex.phpfile. Inindex.php: Write the required code to perform a SELECT query on the products table of the database. You will select all products and order the results by productID.
InviewProducts.phpdisplay the following under the sub-title List products:Using the results from the query performed in 2) above, list the productName and productCode as
- items. These items are not clickable.
InviewProducts.phpunder the sub-title List products and make them selectable.Create a form whose action is index.php and whose method is get. In the form, have a drop down list and a button. Using the query results from problem 1, load the drop down list to show the productNames of all products. The option value of each item of the dropdown list will be the productID. The button has name = action and its value = ListSelect. Inindex.php: Filter input the value of button action. If its value == ListSelect , retrieve the selected items productID and perform validation.] InviewProducts.php display the productID that you just retrieve
InviewProducts.php, under the subtitle Display product table: Create a table element to display the productName and listPrice as separate columns. . Have a third column on the display that contains a form (in each row). In this form have a hidden field that contains the productID for that row. In addition, in the same column , have a button, that has a name action and whose value = TableSelect. Inindex.php, retrieve the value of button action . If its value == TableSelect, retrieve the value of hidden field and perform validation. InviewProducts.php- Display the productID that you just retrieved from the hidden field.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started