[eluser]Christophe28[/eluser]
Hi,
I have some stuff from the database which I put in $data['user'] and then pass it as $data to the view file. However I'd like to use one thing (id) to get something from another model (table)
What I have for now:
Code:
function get_user_info($username) {
// creating a condition for the query
$this->db->where('username', $username);
// executing the query
$sql = $this->db->get('users');
// put the result in a variable
$user = $sql->row();
// returning a row object
return $user;
This result comes in the controller:
Code:
$data['user'] = $this->users_model->get_user_info($username);
But I would like to use something out
$data['user'] in the controller itself ...
How can I get this property?
echo $user->id; (didn't work)
echo $data['user']['id']; (didn't work either)
Thanks for any help!
Christophe