Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] Calling function
#1

(This post was last modified: 05-15-2018, 07:26 PM by davy_yg.)

controllers/posts.php


public function index()
    {
        
        $data["result"] = $this->posts_model->get_all();
        
        $this->load->view('admin/posts/posts', $data);
    }


public function delete_posts($id='')
    {

        $this->posts_model->delete($id);

        index();
    }

I have two functions and I want to call the index function after deleting the post?  Is that possible?

Type: Error
Message: Call to undefined function index()
Filename: C:\xampp\htdocs\coolcicms\application\controllers\posts.php
Line Number: 70

I get this error.

I also tried:

        $this->db->call_function('index');

Then I get "this feature is not available for the database that you are using."
" If I looks more intelligence please increase my reputation."
Reply
#2

Use
Code:
$this->index();
instead of
Code:
index();
Reply
#3

Why don't you take the time to sit down on a weekend and just read the CodeIgniter User's Guide???
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB