[PHP] Join table with clashing fieldnames

2006-11-08 Thread Kris Leech
I have an SQL query which has a simple join, this works and is fine the fields from the secondary table are added to the returned array. But what happens if I add another JOIN to a table which has fields which are the same name? Is there any way to have PHP prefix the key's (fieldnames) of the

Re: [PHP] Join table with clashing fieldnames

2006-11-08 Thread Chris Boget
I have an SQL query which has a simple join, this works and is fine the fields from the secondary table are added to the returned array. But what happens if I add another JOIN to a table which has fields which are the same name? Is there any way to have PHP prefix the key's (fieldnames) of the

Re: [PHP] Join table with clashing fieldnames

2006-11-08 Thread clive
Kris Leech wrote: I have an SQL query which has a simple join, this works and is fine the fields from the secondary table are added to the returned array. But what happens if I add another JOIN to a table which has fields which are the same name? Is there any way to have PHP prefix the key's

Re: [PHP] Join table with clashing fieldnames

2006-11-08 Thread clive
clive wrote: 1. This is a SQL question and not a php one. 2. select a.name as aname, b.name as bname, c.name as cname where a.id=b.id and a.id=c.id from a,b,c oops beer gone to my head, the from should come before the where as most of you I'm sure know. -- PHP General Mailing List

Re: [PHP] Join table with clashing fieldnames

2006-11-08 Thread tedd
At 1:22 PM + 11/8/06, Kris Leech wrote: I have an SQL query which has a simple join, this works and is fine the fields from the secondary table are added to the returned array. But what happens if I add another JOIN to a table which has fields which are the same name? Is there any way to