I am trying to create a dropdown select menu as followed:
I have a table of products and each have a stock column. Let's say a product has a stock of 54. I want the dropdown to start at option 1 all the way to option 54.
Right now I have this:
<?php
## Conection part
$sql = "SELECT * FROM product";
$result = $conn->query($sql);
while ( $row = mysqli_fetch_assoc($result) ) { ## 1 While loop
?>
<tr>
<td><input type="checkbox" name="id[]" value="<?= $row['ProductID'] ?>" /></td>
<td><?php echo $row['ProductID']; ?></td>
<td><?php echo utf8_encode($row['ProductName']); ?></td>
<td><?php echo $row['SKU']; ?></td>
<select>
<option value="1">1</option>
</select>
</tr>
<?php
}
$conn->close();
echo "<br>";
?>
Anyone have any idea how to accomplish this?
Thanks guys!