Want to delete a particular row. how to fetch the id?

zbv2net

New Member
\[code\]$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="http://stackoverflow.com/questions/3615955/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);}\[/code\]Now this $html is echoed afterwards. so in output im getting 1st rhe image, then d name of the image and then a button. now what i want is wen i click the delete button the respective row is deleted from database. which is not happening in the above code as it is unable to fetch the respective id. so pleaser help how can i do that?
 
Back
Top