用户
 找回密码
 入住 CI 中国社区
搜索
查看: 1800|回复: 1
收起左侧

[HELP] 如果没有改动点修改提示修改失败。改动内容就能修改成功

[复制链接]
发表于 2013-3-28 15:22:09 | 显示全部楼层 |阅读模式
本帖最后由 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();
}

在修改页面 不进行修改  单击修改按钮 提示修改失败  。把内容在修改以后 单击修改按钮提示成功!
 楼主| 发表于 2013-3-28 17:20:32 | 显示全部楼层

本版积分规则