In productinfo.php find the echo line inside the while loop. Just after the existing </a> closing tag but still before the </li> add another hyperlink (a element):
- make the href value deleteproduct.php?product=$productID
- as the text for the link put a space then brackets with the word Delete, an X or a small image representing delete inside
Load the page and you should be able to hover over the new link and see the $_GET data.
Create a new and completely empty page called deleteproduct.php and then:
- add a PHP block to contain the rest of the code
- include the functions.php page so that the database connection is set up
- extract the $_GET data (remember mysqli_real_escape_string()) and use it to create a DELETE query to delete just that one record
- test the page by deleting any products you added using insertproducts.php
- once you are sure it is working add a single line of PHP just after the query is run which says header("location:productinfo.php");
The last line will only work if there is no HTML or other output on the page.