X900 发表于 2011-8-23 07:03:58

如何知道CI数据库操作语句状态

$data = array(
                'site_name' => $this->input->post('site_name'),
                'keywords' => $this->input->post('keywords'),
                'title_keywords' => $this->input->post('title_keywords'),
                'copyright' => $this->input->post('copyright'),
                'descript' => $this->input->post('descript'),
                'telephone' => $this->input->post('telephone'),
                'cell_phone' => $this->input->post('cell_phone'),
                'email' => $this->input->post('email')
                );
               
                $this->db->update('options', $data, 'id = 1');




我如何判断 $this->db->update('options', $data, 'id = 1');语句是否操作成功?

小凡 发表于 2011-8-23 15:56:25

return ($this->db->affected_rows() > 0) ? TRUE : FALSE;

X900 发表于 2011-8-24 04:58:28

小凡 发表于 2011-8-23 15:56 static/image/common/back.gif
return ($this->db->affected_rows() > 0) ? TRUE : FALSE;

感谢您的帮助!!!{:1_1:}

守望幸福的孩子 发表于 2012-8-10 16:54:22

学习了,,,,
页: [1]
查看完整版本: 如何知道CI数据库操作语句状态