Re: PHP not parsing joined tables well

From: Date: Mon, 17 May 2004 19:55:50 +0000
Subject: Re: PHP not parsing joined tables well
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-186427@lists.php.net to get a copy of this message
From: "Steve Douville" <php@douville.net> > I'm got a query that is joining a few tables. > > select > par.*, pla.*, pro.*, reg.* > from parent par, players pla, registrations reg, programs pro > where blah blah blah > > Now, a result set is the same but I'm having trouble parsing it because I > have column names that are identical in two of the tables. (A first_name in > parent and first_name in players.) After getting the result set, PHP doesn't > seem to like a reference to par.first_name to differentiate it from > pla.first_name when I'm parsing the results. Even worse, in any given row, > $resultArray['first_name'] only gives the first occurance which is the > parent first name. The other "first_name" column seems unreferenceable. (is > that a word?) > > Anyways, any help is appreciated. There are so many columns to pull, I'd > hate to have to list them all out in the query. That's what you need to do, though. Or use a *fetch_row() function and reference by number instead of name. ---John Holmes...

« previous php.general (#186427) next »