Почему запись после редактирования в форме не записывается в базу данных?
Почему запись после редактирования в форме не записывается в базу данных?
вся запись вызывается из базы данных в форму, редактируется, но не записывается в БД.
Где искать ошибку?
public function edit($slug = NULL) {
if(!$this->dx_auth->is_admin()) {
show_404();
}
$this->data['title'] = 'Редактировать модели';
$this->data['sneki_item'] = $this->sneki_model->getSneki($slug, FALSE, FALSE );
if (empty($this->data['sneki_item'])) {
show_404();
}
$this->data['id_sneki'] = $this->data['sneki_item']['id'];
$this->data['slug_sneki'] = $this->data['sneki_item']['slug'];
$this->data['title_sneki'] = $this->data['sneki_item']['title'];
$this->data['descriptions_sneki'] = $this->data['sneki_item']['descriptions'];
$this->data['price_sneki'] = $this->data['sneki_item']['price'];
$this->data['size_sneki'] = $this->data['sneki_item']['size'];
$this->data['poster_sneki'] = $this->data['sneki_item']['poster'];
$this->data['poster1_sneki'] = $this->data['sneki_item']['poster1'];
$this->data['poster2_sneki'] = $this->data['sneki_item']['poster2'];
$this->data['poster3_sneki'] = $this->data['sneki_item']['poster3'];
$this->data['add_date_sneki'] = $this->data['sneki_item']['add_date'];
$this->data['category_nal_sneki'] = $this->data['sneki_item']['category_nal'];
$this->data['category_color_sneki'] = $this->data['sneki_item']['category_color'];
if($this->input->post('slug') && $this->input->post('title') && $this->input->post('descriptions') && $this->input->post('price') && $this->input->post('size') && $this->input->post('poster') && $this->input->post('poster1') && $this->input->post('poster2') && $this->input->post('poster3') && $this->input->post('add_date') && $this->input->post('category_nal') && $this->input->post('category_color')) {
$id = $this->data['sneki_item']['id'];
$slug = $this->input->post('slug');
$title = $this->input->post('title');
$descriptions = $this->input->post('descriptions');
$price = $this->input->post('price');
$size = $this->input->post('size');
$poster = $this->input->post('poster');
$poster1 = $this->input->post('poster1');
$poster2 = $this->input->post('poster2');
$poster3 = $this->input->post('poster3');
$add_date = $this->input->post('add_date');
$category_nal_sneki = $this->input->post('category_nal');
$category_color = $this->input->post('category_color');
if($this->sneki_model->updateSneki($id, $slug, $title, $descriptions, $price, $size, $poster, $poster1, $poster2, $poster3, $add_date, $category_nal, $category_color)) {
$this->data['title'] = 'Успешно обновлено';
$this->load->view('templates/header', $this->data);
$this->load->view('sneki/edited');
$this->load->view('templates/footer');
}
}
else{
$this->data['title'] = 'Не обновлено';
$this->load->view('templates/header', $this->data);
$this->load->view('sneki/edit', $this->data);
$this->load->view('templates/footer');
} }
После редактирования выполняется else
else{
$this->data['title'] = 'Не обновлено';
$this->load->view('templates/header', $this->data);
$this->load->view('sneki/edit', $this->data);
$this->load->view('templates/footer');
} }