When we change the name="quantity"
and the $product['price']
value will changing too. Here will have dynamic quantity and price. How to do that using jquery/javascript.
<?php
$select = "SELECT * FROM `products` ORDER BY `id` DESC LIMIT 10";
$query = mysql_query($select) or die(mysql_error());
?>
<ul>
<?php while($product = mysql_fetch_array($query)) { ?>
<li>
<p><?php echo $product['name'];?></p>
<p> Quantity
<select name="quantity">
<?php for($i=1;$i<=$product['quantity'];$i++) { ?>
<option value="<?php echo $i; ?>"><?php echo $i; ?></option>
<?php } ?>
</select>
</p>
<p><?php echo $product['price'];?></p>
</li>
<?php } ?>
</ul>
Let me know :)