[RESOLVED] Duplicate Field Names Return In $result

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
tmaiden
Forum Commoner
Posts: 64
Joined: Fri Feb 24, 2006 3:15 pm
Location: Philadelphia
Contact:

[RESOLVED] Duplicate Field Names Return In $result

Post by tmaiden »

I have a SELECT query that returns the same field name from 2 different tables.

Example:
SELECT a.*, b.*
FROM a
INNER JOIN b ON b.id = a.id

It returns all of the fields in the 2 tables but,
when I use $row['id']
how can i tell php which id i want... im my case I want a.id
but $row['id'] actually returns b.id

Thanks

HOPE TITLE WASNT MISLEADING
Last edited by tmaiden on Thu Jun 15, 2006 12:41 am, edited 1 time in total.
User avatar
tmaiden
Forum Commoner
Posts: 64
Joined: Fri Feb 24, 2006 3:15 pm
Location: Philadelphia
Contact:

Post by tmaiden »

row[0]

worked.
Post Reply