php查询mysql多个表字段
sql codeselect id,channel,title from teble1 where id='$id'
我想在查询中添加查询表table2,查询字段为:name,tel应该怎么写?
------解决方案--------------------
逗号为英文状态:
sql codeselect t1.id,channel,title,t2.name,t2.tel from teble1 as t1, table2 as t2 where t1.id='$id'
------解决方案--------------------
探讨
逗号为英文状态:
sql code
select t1.id,channel,title,t2.name,t2.tel from teble1 as t1, table2 as t2 where t1.id='$id'