HTML代码
序号姓名学院班级联系方式性别是否有单反特长时间删除$count=0;
while($rows=mysql_fetch_assoc($rs))
{
echo '
';echo '
'.++$count.'';echo '
'.$rows['name'].'';echo '
'.$rows['grade'].'';echo '
'.$rows['tel'].'';echo '
'.$rows['sex'].'';echo '
'.$rows['danfan'].'';echo '
'.$rows['interest'].'';echo '
'.$rows['time'].'';echo "
删除";echo '
';}
?>
JavaScript
$('.del').click(function(){
id=this.id;
obj =$(this);
$.get('del.php',{id:id},function(r){
obj.parent().parent().hide();
});
});
PHP
$id=$_GET['id'];
mysql_connect('localhost','root','root') ;
mysql_select_db('data');
mysql_query('set names utf8');
$sql="delete from form where id=$id";
if(!mysql_query($sql))
die(mysql_error());
?>