There are two columns in the new table(table1 join table2) which have the same column name, how to get the values of both respectively

前端 未结 4 974
有刺的猬
有刺的猬 2021-01-26 19:05
select * from table1 join table2 on table1.column3=table2.column4 where ...
...
$row=mysql_fetch_assoc($result);

However, there are two columns in the

4条回答
  •  暖寄归人
    2021-01-26 19:37

    Call the columsn out specifically with an alias like

    SELECT table_1.id as table_1_id, table_2.id as table_2_id

    Youll have to list out all or most of the columns form at least one of the tables this way but you can get access to cols with the same name across multiple tables.

提交回复
热议问题