日期:2014-05-17 浏览次数:20582 次
$king->db->connect(); //连接数据库 $link为数据库连接句柄。 $king->db->link->beginTransaction();//回滚起始点 if($rs1=$king->db->getRows_number('%s_newsContent',"newsID in($newsID)")) { if($rs2=$king->db->query("delete from %s_newsContent where newsID in($newsID)")) { $s.="删除新闻内容成功![".$rs2."/".$rs1."条]<br />"; } else { lzj_message('删除新闻内容失败','javascript:history.go(-1)'); } } if($rs1=$king->db->getRows_number('%s_rss',"idValue in($newsID) and tableName='news' and idName='newsID'")) { if($rs2=$king->db->query("delete from %s_rss where tableName='news' and idName='newsID' and idValue in($newsID)")) { $s.="删除新闻RSS成功![".$rs2."/".$rs1."条]<br />"; } else { lzj_message('删除新闻RSS失败','javascript:history.go(-1)'); } } if($rs=$king->db->query("delete from %s_news where newsID in(".$newsID.")")) { lzj_message("删除成功![".$rs."条]<br />".$s,$pageUrl); } else { lzj_message('删除新闻失败','javascript:history.go(-1)'); } $king->db->link->commit();//回滚结束点