3
I have trouble picking up values within an array variable in codeigniter help me understand how this works once and for all I searched the database that is sent to the view by an array: Controller
$dados= array(
'perfil' => $this->perfil->perfil($id)
);
In the view I have the data that came from the controller.
I check my $profile variable with var_dump($perfil)
and it turns up:
Array
(
[0] => stdClass Object
(
[artigo_id] => 2
[artigo_titulo] => A volta de cristo
[artigo_imagem] => 8f5364fb6f5204224529ce3345073906.jpg
[artigo_autor] => Nativo Natan Melo
)
)
How do I get the article author index information? I try to access by doing
$perfil->artigo_autor;
More of a mistake :
Trying to get Property of non-object.
How should I proceed?
Suffice
$perfil[0]->artigo_autor
– rray
There is no way I can access type like this; $profile->artigo_author ?
– Natan Melo
The return of the method has to be
row
– novic
http://stackoverflow.com/questions/6601236/codeigniter-return-result-and-row
– novic