Więcej informacji:
Wersja CI 2.1.4
funkcja kontrolera odpowiedzialna za edycję newsa
function edit_news(){ $id = $this->uri->segment(3, 0); $cat = $this->admin_model->get_cat(); $send = $this->input->post('send'); $title = $this->input->post('title'); $publish = $this->input->post('publish'); $content = $this->input->post('content'); $content_more = $this->input->post('content_more'); $category = $this->input->post('category'); $reason = $this->input->post('reason'); if($send){ $add = $this->admin_model->edit_news($id, $title, $content, $content_more, $publish, $category, $reason); if($add){ $this->template->set_message('<strong>Sukces!</strong><br />Zapisano edycję.', 'alert alert-success'); } } $news = $this->admin_model->get_news($id); 'news' => $news, 'cat' => $cat ); $this->template->set('data', $data); $this->template->render(); }
i model
function edit_news($id, $title, $content, $content2='', $public, $category, $reason=''){ $this->db->select('*'); $this->db->from('news'); $this->db->where('news_id', $id); $query = $this->db->get(); return $query; }else{ 'news_title' => $title, 'news_content' => $content, 'news_content_more' => $content2, 'news_public' => $public, 'news_cat' => $category, 'news_reason_edit' => $reason ); $this->db->where('news_id', $id); $query = $this->db->update('news', $data); return $query; } }
Ja już sam nie wiem przez co to może być ... Może któryś z Kolegów/Koleżanek podsunie mi pomysł czym to jest spowodowane.