[eluser]ShawnMA[/eluser]
***EDITED***
I got it working using:
Code:
<?php foreach ($featured as $row):?>
<h4> <?php echo $row->event_name;?></h4>
<?php endforeach; ?>
Is it really necessary to use a foreach, when there will always only be one row returned?
In my controller, I make a call to my model to query the db for a record and all of its field:
Code:
$data['featured'] = $this->event_model->getFeaturedEventByMetro( $code );
The query does return data, I've confirmed this, but when attempting to access the individual elements via my view, I keep getting:
A PHP Error was encountered
Severity: Notice
Message: Undefined index: event_name
Filename: views/home.php
Line Number: 63
In my view I have the folllowing:
Code:
<h4><?php echo $featured['event_name']; ?></h4>
event_name is a field in the returned row, and it does have a value, I'm thrown for what I'm doing wrong. All help is greatly appreciated.