I've got this so far:
$result=mysqli_query($conn,$sql_query);
$in = mysqli_fetch_array($result)[0];
?>
<table>
<tr>
<th>ID:</th>
<th>Item:</th>
<th>Quantity:</th>
<th>Sell</th>
</tr>
<?php
$ID = 0;
foreach (explode(";", $in) as $element) {
$ID = $ID + 1;
$element = trim($element);
if (strpos($element, " ") !== false ) {
list($car, $number) = explode(" ", $element);
$Form = "<form method = 'post'> <br> <input type ='submit' name = '$ID' value = 'Sell!' <br> </form>";
?>
<tr>
<td><?php echo $ID; ?></td>
<td><?php echo $car; ?></td>
<td><?php echo $number; ?></td>
<td><?php echo $Form; ?></td>
</tr>
<?php
}
}
echo "</table>";
What I was wondering was two things: 1. How can I target every single button as it could range from 1 to 100+ I presume it would use some sort of loop? Not sure how it would work though