Steve Douville wrote:
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.

TIA.


you can use

select *,
pla.first_name pla_first_name, pro.first_name pro_first_name  ...

pla.first_name will be available as $resultArray['pla_first_name'] etc.

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



Reply via email to