我正在尝试合并两个查询。
False & True
和
$query_1 = mysql_query("SELECT * FROM `table1_results` WHERE id=".$_GET['id']);
while($table1_results = mysql_fetch_assoc($query_1)){
$total[] = $table1_results;
}
一切都保持不变,只是我想结合两种不同的方式 表table2_results
和
一个查询中的table2_results
我咨询了很多例子,但没有得到理想的结果,请举例说明问题的正确解决方案 谢谢
答案 0 :(得分:2)
您应该使用内部联接
SELECT * FROM `table1_results` as a
Inner join `table2_results` as b on a.id = b.id
WHERE a.id=".$_GET['id']
答案 1 :(得分:0)
如何选择多个表?
Select * from `table1_results` as t1, `table2_results` as t2
where t1.id = $_GET['id'] OR t2.id = $_GET['id']