Trying to get property of non-object |
Hi all,
I want to make a table with the members list of my website, but i have Trying to get property of non-object as error. Here is my controller: Code: public function memberslist(){ Here is my model: Code: public function memberslist(){
You can pass a database result object directly to table->generate(). It saves you all the trouble of looping through result_array().
The model becomes PHP Code: /** The controller will work as you have it.
(01-25-2018, 11:00 AM)dave friend Wrote: You can pass a database result object directly to table->generate(). It saves you all the trouble of looping through result_array(). CI_DB_mysqli_result as array i have this error now
I found a solution:
My model: PHP Code: public function memberslist(){ My controller: PHP Code: $template = array(
I see where my advice went bad.
In the controller (your original post) the line PHP Code: $tableau = array($this->admin_model->memberslist()); should be changed to PHP Code: $tableau = $this->admin_model->memberslist(); |
Welcome Guest, Not a member yet? Register Sign In |