Welcome Guest, Not a member yet? Register   Sign In
Description length
#11

[eluser]NateL[/eluser]
Code:
A PHP Error was encountered

Severity: Notice

Message: Undefined property: stdClass::$description

Filename: views/animal_view.php

Line Number: 51
tried it without chaining and received the same error.
#12

[eluser]NateL[/eluser]
I've tried using backticks and still get the same errors. I will keep tinkin around and post up a fix, if I find it
#13

[eluser]TheFuzzy0ne[/eluser]
That error is not caused by the database. It looks like you're trying to obtain a property that doesn't exist, from an empty object. Please post the code in your view file.
#14

[eluser]NateL[/eluser]
hi,
Code:
<?php foreach($result as $row):?>
   <td>&lt;?=$row->status?&gt;</td>
   <td>&lt;?=$row->description?&gt;</td>
&lt;?php endforeach; ?&gt;

this is a pretty straight forward foreach loop that works fine whenever I have just 'description'

but as soon as I make it 'LEFT(description,25)' it blows up.
#15

[eluser]TheFuzzy0ne[/eluser]
description doesn't exist, because you need to alias it.

Code:
$this->db->select('id, animal_id, status, visible, LEFT(description,25) AS description', FALSE);
$this->db->order_by("id", "asc");
$query = $this->db->get('available');
#16

[eluser]NateL[/eluser]
That was IT! Confusednake:

THANKS!!!




Theme © iAndrew 2016 - Forum software by © MyBB