當我更新一列時,會更改所有列。我該如何解決?模型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));}
使用帶有 codeigniter 的 ajax 無法進行更新
慕的地8271018
2021-08-28 16:32:23
