Take a look at this article: http://www.thinkingphp.org/2007/02/24/cake-12s-set-class-eats-arrays-for-breakfast/
Dealing with big fat arrays in Cake can be a struggle at first but using the Set::extract method can pull out a set of the data you need very elegantly. See how Felix also uses array_combine to get just a nice set of key/value pairs out a deeply nested array? Anyways I would use extract to get the data you need from Table 1 and then loop over the array and do your UPDATE queries on your second table. On Mar 9, 6:02 am, "Adrian Maier" <[EMAIL PROTECTED]> wrote: > On 3/9/07, AD7six <[EMAIL PROTECTED]> wrote: > > > > > > Are there better ways to fetch the query result one by one ? > > > Why do you want to, what is the goal you want to achieve? > > In short: I'm reading the tuples from table T1, and for each tuple i'm > searching for corresponding tuple in table T2 and , if neccessary, update > some fields of T2 according to the current tuple of T1. > > Sometimes, if there are enough records in T1, my action reaches > PHP's maximum memory limit. I haven't researched to see exactly > what is the number of records when the memory gets filled (but was > less than 15000 records). > > What i want is to fetch the query results one by one, because in this > case i really don't need the array with all the records. > > -- > Adrian Maier --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---