In your select you can do something like this:

[code]
$this->Model->find('xxx', array(
  fields => 'substr(description, 0, 50)',
...
[/code]

On Jun 6, 1:20 pm, "Dave Maharaj :: WidePixels.com"
<d...@widepixels.com> wrote:
> Can cake limit the return on characters in a query?
>
> I have in view
>
> <?php echo substr($additional_posts['description'],0,50);?>
>
> to display the first 50 characters in the post descriptions to give a brief
> description to a user...but rather than pulling the whole description in the
> find then displaying limited characters, can i limit the description to 50
> characters in the find query?
>
> Thanks,
>
> Dave
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to