[eluser]regal2157[/eluser]
Sorry if this is not in the right board, the layout of this forum is a bit confusing.
Anyways, I have a simple and basic question trying to display data from a database.
In my view, a $data variable is passed through, and I am trying to utilize it (and it's contents).
The controller sets the $data['featured_user'] = single row from database.
In the view, I tried to utilize it by doing
Code:
<?php if(isset($featured_user)): echo $row->username; endif; ?>
This presents me with this error:
Quote:A PHP Error was encountered
Severity: Notice
Message: Trying to get property of non-object
Filename: views/options_view.php
Line Number: 162
Then I tried doing it as an array:
Code:
<?php if(isset($featured_user)): echo $featured_user['username']; endif; ?>
This presents me with this error:
Quote:A PHP Error was encountered
Severity: Notice
Message: Undefined index: username
Filename: views/options_view.php
Line Number: 162
I did a print_r on the $featured_user variable, and the username index is set..
Can anyone help me with what I may be doing wrongly?