Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

145
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda