I want to delete a single post from deleteupload.php hence I want to access product_id which is the unique identifier of each row after submission. I have wrapped every product in a form element and a submit button. So the page has multiple form elements.
This is my code:
while ($row = mysql_fetch_array($loop))
{
$proID = $row['product_id'];
echo "<table border='0' width='100%' align='center' class='centrebox'><tr>
<td width='25%'>".($row['product_name']) . "</td> " . "
<td width='35%'>".($row['product_disc'])."</td>";
echo '<td width="40%"><img width="100%" height="300" src="data:image/jpeg;base64,'.base64_encode( $row['product_image'] ).'"/></td></tr>
<td><form method="post" action="deleteupload.php">
<input type="submit" name="$proID" value="Delete"></form></td></table><br>';
}
This while loop iterates through the sql table and echos the columns (product_name, product_disc, and product_image).