哦,为什么你老范这种错误阿??? 你该先好好学学表单的提交问题,然后再作东西。 $query="delete from userinfor where Id=Id";又错了 如果你id 是数字的: $query="delete from userinfor where Id=".$_POST['Id'];如果你id 是字符串的: $query="delete from userinfor where Id='".$_POST['Id']."'";
因为你的条件永远是真的,就等于没有条件,语句就相当于delete from userinfor where Id=Id ,所以就全删除了 !
$query="delete from userinfor where Id=Id";中的where后面的条件为true,当然会全部删除掉了。 正确的做法: $query="delete from userinfor where Id=$Id";
把你的语句改成这样: $query="delete from userinfor where Id=".$id;
你该先好好学学表单的提交问题,然后再作东西。
$query="delete from userinfor where Id=Id";又错了
如果你id 是数字的:
$query="delete from userinfor where Id=".$_POST['Id'];如果你id 是字符串的:
$query="delete from userinfor where Id='".$_POST['Id']."'";
正确的做法:
$query="delete from userinfor where Id=$Id";
$query="delete from userinfor where Id=".$id;