Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

148
Views
Populating the price of a product into a dropdown from a parent dropdown list

--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.

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!