--I am using the query below to select all product ID's
$query = "SELECT DISTINCT p.ProductID, p.Product_Name FROM products p, store_inventory s WHERE p.ProductID = s.Product_ID";
$statement2 = $db->prepare($query);
$statement2->execute();
$products2 = $statement2;
--Using a Select to Choose the products
<label id="label">Product ID by Name:</label><br>
<select id="ProductID" name="ProductID" style="width: 300px">
<option>Select Product:</option
<?php foreach($products2 as $p) : ?>
<option value="<?php echo $p['ProductID']; ?>"><?php echo$p['Product_Name']; ?></option>
<?php endforeach; ?>
</select>
How would I get the product ID and display the price(s) into a dropdown list? Id like to select Item_Price from products where ProductID = :ProductID but not sure how to complete this on the same page.