|
楼主 |
发表于 2009-5-26 16:27:46
|
显示全部楼层
$this->db->where("id =",$id);
$query1=$this->db->get("zk_article");
foreach($query1->result() as $row):
$articlesort=$row->articlesort;
endforeach;
$articlesort2=$articlesort+1;
$data1=array('articlesort'=>2,);
$this->db->where("id =",$id);
$this->db->update("zk_article",$data1);
$articlesort1=$articlesort;
$data2=array('articlesort'=>1,);
$this->db->where('mk_name =',$mkname);
$this->db->where('articlesort',$articlesort);
$this->db->update('zk_article',$data2);
if($query1){return true;}else{return false;} |
|