On 12-03-22 01:06 PM, Jay Blanchard wrote:
On 3/22/2012 11:40 AM, Robert Cummings wrote:
What's the field for which you are selecting data? I've written this
up as a parent/child relationship but it works for data/sub-data
relationships also.

SELECT itemId, otherData FROM table WHERE "some condition";

SELECT itemId, subData FROM otherTable WHERE itemId IN (id1, id2, ...);

Then just link up the sub-data to the primary data in a loop and
finally generate your JSON.

Does that clarify?
[/snip]

I must confess that the raging sinus headache and my general confusion
makes this really unclear for me today. Maybe I should just set it aside
for a day or so. I am super dense today.

Rest might do you well on a number of levels :)

For each level I am selecting for each parent in the level above. Let's
say that level 2 contains 8 people. Level 3 contains 14 people. Only
some of the 14 belong to the 8 and must be associated properly. So how
can I, with one query, associate level 3' 8th, 9th and 10th people with
level 2's 6th person keeping in mind that the 9th person might also
belong to level 2's 4th person.

At one point you indicated all the data was coming from one table. Can you send me the table fields and indicate which fields are used to determine parent child relationship? Also 2 sample rows of data which have a relationship would be helpful.

Just link up the sub-data? Place this array into a child array of the
parent array? Again I apologize - maybe I should push away and let the
customer know that it'll be a couple of more days.

Yeah... child array... 'children' :)

Cheers,
Rob.
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to