php如何无限分类删除
1个回答
推荐于2016-07-02
展开全部
$act = isset ($_GET['act']) ? trim ($_GET['act']) : ";
if ($act ==
'del')
{
$sort_id = isset ($_GET['id']) ? intval($_GET['id']) : '0' ;
$sort_ids = $sort_id;
$childrenIds = getChildrenIds ($sort_id);
if
(!empty ($childrenIds))
{
$sort_ids .= $childrenIds;
}
$sql =
“delete from `article_sort` WHERE `sort_id` in ({$sort_ids})";
$res =
mysql_query ($sql);
if ($res)
{
alert ('删除成功');
exit;
}
else
{
alert ('删除失败');
exit;
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询