2 ways about it.

One, switch on debug=1 (atleast) in core.php.  This should give you
the query and some indication on how to fix it.

Two, if the idea is to limit the amount of characters displayed in the
view, then handle it in the index.ctp like this

echo "<td>".(strlen($data['records'][$i][$field["table"]][$field
["title"]]) > 25?substr($data['records'][$i][$field["table"]][$field
["title"]],0,22)."...":$data['records'][$i][$field["table"]][$field
["title"]] )."&nbsp;</td>";


On Feb 4, 12:28 pm, gkc <[email protected]> wrote:
> I need to limit the amount of characters returned on a field.
>
> I have tried using 'fields'=>array('LEFT(field,200) AS \'field\'') but
> I get an undefined index: field error when I do this.
>
> Any suggestions would be greatly appreciated.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to