I have two tables in MySQL database, table A, table B.
Table A and B have relation (A.m_id=B.id), and they also have the field called "id", but they are not the same thing (i.e. A.id != B.id).
I would like to retrieve data by using sql in my php file:
...
$res=mysql_query("select * from A, B where A.m_id=B.id");
while ($row=mysql_fetch_array($res)){
echo $row["id"];
}
...
The result is B's id but not A's id. Could you tell me how can I retrieve A's id?