On Fri, Nov 5, 2010 at 4:19 AM, Adrian Arnautu <[email protected]> wrote:
> Hello to everyone,
> Is there a way to get a resource and then fetch a row at a time from it
> instead of getting the whole rows in one structure?
> For a small dataset it's relatively fine, but when this dataset is growing
> (for example, you want to generate a CSV having ~ 5-6k rows or maybe more)
> it looks overkilling in terms of memory requirements.
> I know that the possible answer is somewhere in the source code, I want to
> know if any of you used this approach.

You could set 'limit' in your find() and loop until it returns no more
results. Don't forget to set the offset, of course.

Or, I suppose you could use paginate() as well, changing the 'page'
param each iteration.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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