Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要从多个表中提取信息,但我不希望存档等于零的条目。当我从一张桌子上做这件事时,我可以做到这一点,但是当我从多个桌子上尝试它时它不起作用..请帮忙!
if ($_SESSION['user_type']== 1){ $sql="SELECT * FROM orlando,indy WHERE archive='0'"; $result=mysql_query($sql); } else die('You do not have access');
你可以看看是否UNION ALL适合你正在尝试做的事情......
UNION ALL
SELECT * FROM orlando WHERE archive='0' UNION ALL SELECT * FROM indy WHERE archive='0'
select * from orlando,indy where orlando.archive <> '0' and indy.archive <> '0'