php 中怎么实现点击按钮 然后从MYSQL中删除对应行的数据..希望高手教我

<table width="600" border="1">
<tr>
<td width="300"><? echo $myrow["name"] ?></td>
<td width="300"><? echo $myrow["sex"] ?></td>
<td width="300"><? echo $myrow["age"] ?></td>
<td width="300"><? echo $myrow["address"] ?></td>
<td width="300"><a href="xiugai.php">修改信息</a></td>
<td width="300"><input type="submit" name="Submit" value="删除" /> </td>
</tr>
</table>
include("conn.php");
if(!empty($_POST['Submit'])){
$name=$_POST['name'];
$sql="delete from student where name='$name'";
$query=mysql_query($sql);
if($query){
echo "<script>alert('删除成功');
history.back();</script>";
代码哪里有问题?麻烦解释下~~

我就想要点击删除按钮然后把那一条都给删掉~~

求大神指教~~

<form name="subscription" action="这个是你PHP文件的路径" method="post">
<input type="hidden" name="id" value="<?php echo $myrow["id"] ?>"/>
<table width="600" border="1">
<tr>
<td width="300"><?php echo $myrow["name"] ?></td>
<td width="300"><?php echo $myrow["sex"] ?></td>
<td width="300"><?php echo $myrow["age"] ?></td>
<td width="300"><?php echo $myrow["address"] ?></td>
<td width="300"><a href="xiugai.php">修改信息</a></td>
<td width="300"><input type="submit" name="Submit" value="删除" /> </td>
</tr>
</table>
</form>
<?php
include("conn.php");
if(!empty($_POST)){
$id = $_POST['id'];
$sql = "delete from student where id='$id'";
$query = mysql_query($sql);
if($query){
echo "<script>alert('删除成功');history.back();</script>";
}
}
?>
温馨提示:答案为网友推荐,仅供参考