首页上一页 1 下一页尾页 1 条记录 1/1页
老师:关于mysql_fetch_array函数输出记录问题.谢谢
发表在PHP图书答疑
2016-08-07
是否精华
是
否
版块置顶:
是
否
我试了一下加上where id between $b and $num就没法全部正确输出,只输出某一条。这是为什么呢?我想要从某个特定的id开始输出,该怎么改呢?
$sql0 ="select * from tb_include where id between $b and $num";
$rs0 =mysql_query($sql0);
echo mysql_num_rows($rs0); //3条记录 输入 a=2
//mysql_data_seek($rs0,0);
while($rst =mysql_fetch_array($rs0))
{
$sql ="delete * from tb_include where id=$b";
mysql_query($sql);
echo "编号".$rst[0]."姓名为".$rst[1]."的员工已经成功删除<br>";
}
}
$sql0 ="select * from tb_include where id between $b and $num";
$rs0 =mysql_query($sql0);
echo mysql_num_rows($rs0); //3条记录 输入 a=2
//mysql_data_seek($rs0,0);
while($rst =mysql_fetch_array($rs0))
{
$sql ="delete * from tb_include where id=$b";
mysql_query($sql);
echo "编号".$rst[0]."姓名为".$rst[1]."的员工已经成功删除<br>";
}
}