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

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 Programming Questions!