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

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.

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

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.

<?php foreach($result as $row):?>
&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.

description doesn't exist, because you need to alias it.

$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');

That was IT! Confusednake:


Theme © iAndrew 2016 - Forum software by © MyBB