Question: Need PHP code, in the screenshot below the Edit button should bring up a page that edits the information listed in the table for that

Need PHP code, in the screenshot below the Edit button should bring up a page that edits the information listed in the table for that product. A drop down menu should also be shown that allows you to change the category that the product belongs to

Need PHP code, in the screenshot below the Edit button should bring

The code for the screenshot above is listed below:

// Get category ID if (!isset($category_id)) { $category_id = filter_input(INPUT_GET, 'category_id', FILTER_VALIDATE_INT); if ($category_id == NULL || $category_id == FALSE) { $category_id = 1; } } // Get name for selected category $queryCategory = 'SELECT * FROM categories WHERE categoryID = :category_id'; $statement1 = $db->prepare($queryCategory); $statement1->bindValue(':category_id', $category_id); $statement1->execute(); $category = $statement1->fetch(); $category_name = $category['categoryName']; $statement1->closeCursor();

// Get all categories $query = 'SELECT * FROM categories ORDER BY categoryID'; $statement = $db->prepare($query); $statement->execute(); $categories = $statement->fetchAll(); $statement->closeCursor();

// Get products for selected category $queryProducts = 'SELECT * FROM products WHERE categoryID = :category_id ORDER BY productID'; $statement3 = $db->prepare($queryProducts); $statement3->bindValue(':category_id', $category_id); $statement3->execute(); $products = $statement3->fetchAll(); $statement3->closeCursor(); ?>

My Guitar Shop

Product Manager

Product List

Code Name Price Delete Edit

Add Product

List Categories

© My Guitar Shop, Inc.

Thank you,

Ratings will be given upon answer

Product Manager Product List Categories Guitars Basses Drums Keyboards Synthesizer Guitars Code : Name :Price: Delete ; Edit les_paul Gibson Les Pa 1199.00 Delete Edit 2517.00 Delete Edit Sg Gibson SG fg700s Yamaha FG700S489.99 Delete Edit washburn Washburn D10S299.00 Delete Edit rodriguez Rodriguez Caballero 11 415.00Delete Edit Add Product List Categories Product Manager Product List Categories Guitars Basses Drums Keyboards Synthesizer Guitars Code : Name :Price: Delete ; Edit les_paul Gibson Les Pa 1199.00 Delete Edit 2517.00 Delete Edit Sg Gibson SG fg700s Yamaha FG700S489.99 Delete Edit washburn Washburn D10S299.00 Delete Edit rodriguez Rodriguez Caballero 11 415.00Delete Edit Add Product List Categories

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!