[eluser]trope[/eluser]
I am expanding a bit on the blog tutorial.
I am passing a "success" message to my view, which tells the user the record was created successfully.
The problem is, when I insert the records and return to the "admin_view" view, no records are shown (even though they are there).
It appears the URL is wrong when it loads the view.
Here is my newbie code:
Code:
function index()
{
$data = array();
/* Check to see if we have records available */
if($query = $this->admin_model->get_records() )
{
$data['records'] = $this->admin_model->get_records();
}
$this->load->view('admin_view', $data);
}
function add_post(){
$this->load->view('admin_create_view');
}
function create_new_post(){
$data = array(
'title' => $this->input->post('title'),
'body' => $this->input->post('body'),
'date_posted' => date("Y-m-d")
);
$this->admin_model->add_record($data);
$data['notification_message'] = "You have successfully created a new blog post";
$this->load->view("admin_view",$data);
}
So when I insert a record, it DOES display the success message, but no records are displayed. And the URL after the insert appears not to have changed.
I have attached screenshots of the error.
Thanks, and glad to be here!
John