mysql_fetch_assoc() question regarding field names
Posted: Fri Mar 12, 2010 12:51 pm
Greetings:
I have a very large query that pulls using some joins from 3 or 4 tables. The output is then grabbed through mysql_fetch_assoc(). When I'm pulling my data in the query, I'm using table aliases like l.id, l.bedrooms, l.street FROM listings AS l
By using this, I figured I could output the data as $data['l.street'] but it doesn't work. $data['street'] works just fine.
My question is, if I have two tables with the same field name, how do I distinguish them in the output?
I have a very large query that pulls using some joins from 3 or 4 tables. The output is then grabbed through mysql_fetch_assoc(). When I'm pulling my data in the query, I'm using table aliases like l.id, l.bedrooms, l.street FROM listings AS l
By using this, I figured I could output the data as $data['l.street'] but it doesn't work. $data['street'] works just fine.
My question is, if I have two tables with the same field name, how do I distinguish them in the output?