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"
<[email protected]> 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 [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
-~----------~----~----~----~------~----~------~--~---