php+mysql select a.*,b.* from tb1 as a,tb2 as b的查询问题
假设有两各表分别为tb1和tb2,字段如下 tb1的字段:id,name tb2的字段:id,tb1id,name 现在用sql语句:select a.*,b.* from tb1 as a,tb2 as b where a.id=b.tb1id 来检索符合条件的数据 在mysql的命令行中能显示,但是怎么用php语法来显示获取的数据呢? 比如我想要a.id,b.name,直接用php的rs["a.id"]是不对的。不知道这个语法怎么写~~~~
这个我也知道,能输出数组,但是不能达到我的要求。
比如我想要一个表:
'select a.*,b.* from tb1 as a,tb2 as b where a.id=b.tb1id and b.name=''动画片';
tb1 tb2
id name id tb1id name
要怎么用php语法来区分a.id a.name和b.id b.name呢?