Help needed in using an array to replace nested sql queries
Running into some trouble with the MVC approach and I think it's a result of "old world" thinking. Basically I'm trying to understand how to implement the right array structure to aovid nested querying [potentially requiring me to put the query into the view].
For the sake of the question I've simplified the structure.
I've got two tables:
What I want to display out is the list name and the items under it. Those items are essentially infinite as is the number of lists so it's not a simple join issue.
How would I go about building an array structure to collect both the top level list details as well as the corresponding, and potentially infinite, list item records in my model then loop them back out to a view and thus avoid stacking up queries?