当我更新一列时,会更改所有列。我该如何解决?模型public function update($where, $data){ $this->db->update($this->table, $data, $where); return $this->db->affected_rows();}控制器:public function ajax_update(){ $data = array( 'book_title' => $this->input->post('book_title'), 'book_isbn' => $this->input->post('book_isbn'), 'book_yop' => $this->input->post('book_yop'), 'book_active' => $this->input->post('book_active'), 'publisher_name' => $this->input->post('publisher_name'), 'author_name' => $this->input->post('author_name'), ); $this->user_model->update( $this->input->post('book_id'), $data); echo json_encode(array("status" => TRUE));}
2 回答
- 2 回答
- 0 关注
- 168 浏览
添加回答
举报
0/150
提交
取消