I'm trying to figure out I keept getting "trying to get property of non object in my view file. It says its an object in the print r function I ran on the $messages variable but yet it still says that error message.
Array (
[0] => stdClass Object (
[id] => 1 [subject] => Testing Message 1
[firstName] => Jeffrey
[lastName] => Davidson
[dateSent] => April 1st, 2012
[messageRead] => 0 )
[1] => stdClass Object (
[id] => 1 [subject] => Testing Message 1
[firstName] => Jeffrey
[lastName] => Davidson
[dateSent] => April 1st, 2012
[messageRead] => 0 ) )
<?php if (!is_null($messages[0])) {
foreach ($messages[0] AS $message) {
echo '<tr>'; echo '<td style="text-align: center">'; switch ($message->
messageRead) { case 0: echo '
<img src='.base_url().'assets/img/icons/packs/fugue/16x16/mail.png />
'; break; case 1: echo '
<img src='.base_url().'assets/img/icons/packs/fugue/16x16/mail-open.png />
'; break; case 2: echo '
<img src='.base_url().'assets/img/icons/packs/fugue/16x16/mail-reply.png />
'; break; case 3: echo '
<img src='.base_url().'assets/img/icons/packs/fugue/16x16/mail-forward.png />
'; break; } echo '
</td>
'; echo '
<td>
'.$message->dateSent.'
</td>
'; echo '
<td>
<a href='.base_url().'pmsystem/viewmessage/ '.$message->id.'>'.$message->subject.'</a>
</td>
'; echo '
<td>
'.$message->firstName.' '.$message->lastName.'
</td>
'; echo '
<td style="text-align: center">
'; $data = array('name' => 'message_id', 'class' => 'messages', 'value' => $message->id); echo form_checkbox($data); echo '
</td>
'; echo '
</tr>
'; } } ?>