Re: mySQL / PHP Join Question

From: Date: Mon, 10 Sep 2001 01:11:56 +0000
Subject: Re: mySQL / PHP Join Question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-66641@lists.php.net to get a copy of this message
On Sun, 9 Sep 2001 13:34, Dana Holt wrote: > I have a query that uses a LEFT JOIN, but the two tables have some > columns with the same name. How can I tell the columns from each table > apart? It seems that the "joined" table overwrites the values from the > other table. > > Anyone know? > > Thanks. > > -- > Dana Holt / danah@home.com Describe them as tablename.fieldname and you may want to alias them so you can differentiate in PHP. For example, if you have tables 'person' and 'place', both with a field 'description', you could use something like SELECT person.description AS pdesc, place.description AS wdesc FROM person, place WHERE .... -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA "I was the first to climb Mount Everest," said Tom hilariously.

« previous php.general (#66641) next »