|
本帖最后由 z53525458 于 2013-3-28 16:05 编辑
function article_edit()
{
$data ['pid'] = $this->input->post('class');
$data ['seobiaoti'] = $this->input->post('seotitle');
$data ['duanbiaoti'] = $this->input->post('biaoti');
$data ['toutiao'] = $this->input->post('toutiao');
$data ['tuijian'] = $this->input->post('tuijian');
$data ['huandeng'] = $this->input->post('huandeng');
$data ['tejian'] = $this->input->post('tejian');
$data ['gundong'] = $this->input->post('gundong');
$data ['xianshi'] = $this->input->post('xianshi');
$data ['tupian'] = $this->input->post('tupian');
$data ['paixu'] = $this->input->post('paixu');
$data ['yuantu'] = $this->input->post('pictrue');
$data ['suoluetu']= $this->input->post('pictrue');
$data ['laiyuan'] = $this->input->post('from');
$data ['zuozhe'] = $this->input->post('author');
$data ['guanjianzi'] = $this->input->post('keyworld');
$data ['miaoshu'] = $this->input->post('desciption');
$data ['liulancishu'] = $this->input->post('times');
$shijian=$this->input->post('addtime');
$data ['tianjiashijian'] =isset($shijian)&&!empty($shijian)?$shijian:date("Y-m-d");
$data ['shengchengming'] = $this->input->post('url');
$data ['neirong'] = $this->input->post('content');
$this->load->model('Article_model');
$ok=$this->Article_model->article_edit("id",$this->uri->segment(4),"zero_article",$data);
if($ok>0)
{
echo "<script>alert('修改成功!!');history.back();</script>";
} else {
echo "<script>alert('修改失败!!');history.back();</script>";
}
function article_edit($whatid,$id,$table,$data)
{
$this->db->where($whatid, $id);
$this->db->update($table, $data);
return $this->db->affected_rows();
}
在修改页面 不进行修改 单击修改按钮 提示修改失败 。把内容在修改以后 单击修改按钮提示成功!
|
|