RE: [PHP] collapse SELECT from multiple tables

2005-03-24 Thread David Christensen
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-

RE: [PHP] collapse SELECT from multiple tables

2005-03-24 Thread Chris W. Parker
David Christensen 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:

RE: [PHP] collapse SELECT from multiple tables

2005-03-24 Thread David Christensen
My apologies! I thought I was giving what I was getting as far as the angle of my post. I still don't think everyone is understanding what I'm after here though. I know how to use the mysql functions in PHP. That is not my problem. I'm trying to avoid having to make multiple queries to the db

RE: [PHP] collapse SELECT from multiple tables

2005-03-24 Thread Chris W. Parker
David Christensen on Thursday, March 24, 2005 12:07 PM said: > NO Spanky! > > I figured it was implied that I was looking for a PHP solution since I > posted to a PHP list! > > I also didn't ask for help with HTML output. I was asking for help > with PHP output! Y

RE: [PHP] collapse SELECT from multiple tables

2005-03-24 Thread Jay Blanchard
[snip] I figured it was implied that I was looking for a PHP solution since I posted to a PHP list! [/snip] Bad assumption. [snip] I also didn't ask for help with HTML output. I was asking for help with PHP output! [/snip] I did it with PHP [snip] Let me try to explain it a little better... [/

RE: [PHP] collapse SELECT from multiple tables

2005-03-24 Thread David Christensen
NO Spanky! I figured it was implied that I was looking for a PHP solution since I posted to a PHP list! I also didn't ask for help with HTML output. I was asking for help with PHP output! Let me try to explain it a little better... I need to produce an array of results from two tables. The fi

RE: [PHP] collapse SELECT from multiple tables

2005-03-24 Thread David Christensen
YES! All it does differently is truncate the output to one row per entry in tableA. On Thu, 2005-03-24 at 11:35 -0800, Chris W. Parker wrote: > David Christensen > on Thursday, March 24, 2005 11:24 AM said: > > > Your example doesn't produce the desired the result

RE: [PHP] collapse SELECT from multiple tables

2005-03-24 Thread Jay Blanchard
[snip] Your example doesn't produce the desired the results! The reason I posted to the PHP list was I thought I would have to apply some ARRAY functions to produce the output I'm looking for. Your example did nothing more than mine produced. [/snip] It produces EXACTLY what you asked for in th

RE: [PHP] collapse SELECT from multiple tables

2005-03-24 Thread Chris W. Parker
David Christensen on Thursday, March 24, 2005 11:24 AM said: > Your example doesn't produce the desired the results! > > The reason I posted to the PHP list was I thought I would have to > apply some ARRAY functions to produce the output I'm looking for. > Your exa

RE: [PHP] collapse SELECT from multiple tables

2005-03-24 Thread David Christensen
Your example doesn't produce the desired the results! The reason I posted to the PHP list was I thought I would have to apply some ARRAY functions to produce the output I'm looking for. Your example did nothing more than mine produced. On Thu, 2005-03-24 at 12:48 -0600, Jay Blanchard wrote: > [

Re: [PHP] collapse SELECT from multiple tables

2005-03-24 Thread John Nichel
Jay Blanchard wrote: SELECT p.users FROM php.list p LEFT OUTER JOIN mysql.list m ON (p.phpuserid = m.mysqluserid) GROUP BY p.users HAVING clue > 0; I got zero results returned. ;) -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.n

RE: [PHP] collapse SELECT from multiple tables

2005-03-24 Thread Jay Blanchard
[snip] I'm trying to figure out the best way to handle a SELECT from multiple tables where a single ID in tableA relates to multiple ID's in tableB: "SELECT tableA.ID, tableB.data FROM tableA, tableB WHERE tableA.ID=3 AND tableA.ID=tableB.tableAID" What I'm trying to product is an array output si

Re: [PHP] collapse SELECT from multiple tables

2005-03-24 Thread John Nichel
David Christensen wrote: Comeon guys, this is the PHP mailing list. The MySQL mailing list is over on the next block. -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] collapse SELECT from multiple tables

2005-03-24 Thread David Christensen
I'm trying to figure out the best way to handle a SELECT from multiple tables where a single ID in tableA relates to multiple ID's in tableB: "SELECT tableA.ID, tableB.data FROM tableA, tableB WHERE tableA.ID=3 AND tableA.ID=tableB.tableAID" What I'm trying to product is an array output similar t