I am trying to do the following:
<?php foreach($sqlResult as $row): ?>
<tr>
<?php foreach($formdata['columns'] as $column): ?>
<td><?php echo $row->$column['name']; ?></td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
This does not work.
$row is returned by my mysql query, it has the following : $row->id, $row->author, $row->date, $row->title and these work as they echo fine.
$columns is the following array:
'columns' => array
(
1 => array
(
'name' => 'id'
),
2 => array
(
'name' => 'author'
),
3 => array
(
'name' => 'date'
),
4 => array
(
'name' => 'title'
)
it also works fine as $column['name'] echoes id, author, date, title
my question is how would it be possible for me to access the $row->method (is it a method?) by passing it a name from the array??