Well, whatever you do, Cake won't "categorize" your results by state
for you, so you'll end up having the post-processing loop anyway.
(Unless there is some functionality for this hidden away somewhere -
it would come in handy).

Efficiency is only worth worrying about when it becomes an issue,
imho. If you honestly expect your results to be too large to process,
then by all means cook up some more complex SQL. But if you're not
expecting hundreds of thousands of rows to be returned, it's really
not worth the effort.

More important, when it comes to optimization, is properly structuring
your database (creating the right indexes on the right key
combinations, but only adding the ones you need. Hint: use EXPLAIN
SELECT), and managing caching.

If you think having a "large" chunk of code in the controller method
looks untidy, you could move it to the specific model, or even to a
behavior if it's going to be reused in other models. Shame there isn't
a Set::groupBy() method.

On Dec 7, 12:34 pm, kiger <[EMAIL PROTECTED]> wrote:
> @AD7six
> Sorry I was unable to eloquate myself clearer. What I wanted to do was
> kind of hard to explain.
>
> @grigri
> Thanks for wrapping your head around this. Your second guess was
> correct, in that I already have the keywords inputted. I have yet to
> learn AJAX.
>
> Your solution is spot on to what I have now, though you wrote it
> cleaner than me. In your last sentence you nailed home what I'm trying
> to do now. I am not that good with actual mySQL statements and would
> love to be able to wrap all this into one or two mySQL statements. I
> figure the more I can get into mySQL the more the load on the server
> will decrease. Any ideas on how I could do that?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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