我的更新不起作用,但我在其網(wǎng)站上使用了相同的代碼。 https://mbahcoding.com/tutorial/php/codeigniter/codeigniter-ajax-crud-modal-server-side-validation.html我在網(wǎng)絡(luò)預(yù)覽中的更新 chrome網(wǎng)絡(luò)預(yù)覽中的示例網(wǎng)站更新 chrome這是關(guān)于網(wǎng)絡(luò)響應(yīng)的 ajax 更新。 我嘗試了正常的方法,但總是有錯(cuò)誤。控制器...... 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'), 'author_name' => $this->input->post('author_name'), 'publisher_name' => $this->input->post('publisher_name'), ); $this->user_model->update_book(array('book_id' => $this->input->post('book_id')), $data); echo json_encode(array("status" => TRUE));}模型..........public function update_book($data, $where){ $this->db->update('books',$data,$where); return $this->db->affected_rows();}如果我 print_r($data); 吹是結(jié)果。我認(rèn)為我的問題是數(shù)據(jù)沒有傳遞到數(shù)據(jù)庫。
使用 ajax 更新不適用于數(shù)據(jù)表和 codeigniter
慕碼人8056858
2021-08-27 10:01:44