RE: [PHP] collapse SELECT from multiple tables
| From: | David Christensen | Date: | Thu, 24 Mar 2005 21:16:59 +0000 |
| Subject: | RE: [PHP] collapse SELECT from multiple tables | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-211522@lists.php.net to get a copy of this message | ||
Thanks, I just use my original SQL and setup a foreach loop to compare
the 'ID' to see whether or not a record was returned with multiple row
results.
I was just hoping someone had all ready figured out some kool, neato,
voodoo-magic way to handle a one-to-many result like this.
On Thu, 2005-03-24 at 13:02 -0800, Chris W. Parker wrote:
> David Christensen <mailto:davidc@connect4less.com>
> on Thursday, March 24, 2005 12:34 PM said:
>
> > I don't know how to say it any plainer than that.
> >
> > The original post would have produced the following:
> >
> > 1, 'joe', 'part1'
> > 1, 'joe', 'part2'
> > 1, 'joe', 'part3'
> >
> > but what I'd like to get is:
> > 1, 'joe', 'part1, part2, part3'
>
> I think this is the explanation we needed.
>
> Serious question: Is it that you want someone to write the loop for your
> do you just need some ideas?
>
> > Thanks for your help. I think I may have to redesign this thing to
> > make this easier or I maybe I just don't have the vocabulary to ask
> > the question correctly.
>
> A redesign sounds good. Maybe instead of trying to make an oddly
> structured array you can instead adjust the code that receives the array
> to receive the unmodified array?
>
>
> Chris.
>