PHP头条
热点:

php批量删除数据


批量删除文章这个技术没什么高深莫测的,只是想写下来与大家分享。(适合初学者:)
1、首先在文章列表页面(list.php),将多选筐命名为:“$del_id[]”,值为文章ID号。
例如(list.php):

$result=mysql_query("select * from news");
while($rs=mysql_fetch_array($result)){
?>

}
?>

2、处理页面(del.php):
if($del_id!=""){
$del_num=count($del_id);
for($i=0;$i<$del_num;$i++){
mysql_query("Delete from news where id='$del_id[$i]'");
}
echo("

相关文章

PHP之友评论

今天推荐