jump to navigation

Call to a member function …. di codeigniter July 21, 2010

Posted by budijati in Programming PHP.
trackback

coba2 codeigniter,

function GetAll()
{

$this->load->model(‘employee_model’);

$data['query'] =
$this->employee_model->employee_getall();

$this->load->view(‘employee_viewall’, $data);
}

dijalankan ko error

Call to a member function on a non-object”.

ubah aja jadi

function GetAll()
{
$CI =& get_instance();

$this->load->model(‘employee_model’);

$data['query'] =
$CI->employee_model->employee_getall();

$this->load->view(‘employee_viewall’, $data);
}

Comments»

No comments yet — be the first.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.