PHP returning object echoing out the values?

You cannot echo an object directly. Create a method toString () or serialize the object before echoing.

You cannot echo an object directly. Create a method __toString() or serialize the object before echoing.

You're on the right track. A few things. You're missing a closing ) in this line.

$data'users' = $this->users_model->get_by($this->session->userdata('user_id')); Also, It's hard to know what is being returned by your users model. Can you provide the code for $this->users_model->get_by()? That's where your problem will be.

Make sure you have your db query returning the object as you expect. You may need to add ->row() .

Maybe it's because you're sending a variable called "users" to your view.. but in your view you call the variable $user and not $users if not... the doc on views says: Note: If you use an object, the class variables will be turned into array elements. Good Luck!

For Codeigniter, you need to call $users->result(), $users->result_array(), $users->row() or $users->row_array() to access the DB result object data codeigniter.com/user_guide/database/resu... Assuming a single row is returned: $data'users' = $this->users_model->get_by($this->session->userdata('user_id'); $data'users' = $data'users'->row(); $this->load->view('view', $data).

Make sure you have your db query returning the object as you expect. You may need to add ->row() .

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions