I have a couple tables in my database that have a column named "name". When i do a join on these tables how can i specify which name column i want to output. To clarify i want to get the name column from each table but after i retrieved it from the database how can i specify which one im trying to ouput
Example
$sql = "SELECT * FROM table1,table2,table3"
$result = mysql_query($sql)
$obj = mysql_fetch_object($result)
// I would like to output the name column from table1
echo $obj->name;
// I would like to output the name column from table2
echo $obj->name;
// I would like to output the name column from table3
echo $obj->name;
I probably should of done a better design so i wouldnt of ran into this problem, but its too late to fix that. Any suggestions?
Thanks in advance.