$sql = "SELECT * FROM computers WHERE order_no = '$odn' UNION SELECT * FROM keyboard WHERE order_no = '$odn'";
$sqlresult = mysql_query($sql);
while($sqlrow = mysql_fetch_assoc($sqlresult)){
$retrieveordersubjectlevelsarray[] = $sqlrow;
}
print_r($retrieveordersubjectlevelsarray);
伙计我有上面的代码从2个表中检索相同的订单号。当我print_r结果时,它不显示计算机表和键盘中的行。当我删除union语句变为如下所示时,它将仅显示计算机表中的行。怎么解决这个问题?
$sql = "SELECT * FROM computer WHERE order_no = '$odn'";