$html="";
$sql="SELECT * FROM tiger;";
$rs=mysql_query($sql);
while($row=mysql_fetch_array($rs)){
$html.=
'<tr><td align="left"><img src="'.$row['image'].'" width="200" height="150" /></td>
<td align="center" style="font:bold">'.$row['name'].' </td>
<td align="center"><input type="submit" name="Submit" value="Delete" />
<input name="id" type="hidden" value="'.$row['id'].'" /> </td>
</tr>'
;
}
if($_REQUEST['Submit']){
$sql1="delete image from tiger where id='".$_REQUEST['id']."'";
$query=mysql_query($sql1);
}
Now this HTML code is reflected again. therefore, the im output is the 1st image, then the d-name of the image, and then the button. now I want me to click the delete button, the corresponding row is deleted from the database. which does not occur in the above code, because it cannot get the corresponding identifier. so pleaser will help, how can I do this?
source
share