I stored values from an sql query in an array by looping it. I need the value from that array based on which one the user chooses and store it in another variable. 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 in the second echo). If I echo product_id, it gives me the id for that specific row. As you can see, I have a Delete button that posts to deleteupload.php. I need the id from the form on that specific index to use. I don't know if I explained it well enough, but please bare with me. Thanks
Aucun commentaire:
Enregistrer un commentaire