我从 bluefleet (BF) 获得了一些关于 mysql 查询的帮助,我现在需要在 php 环境中使用该查询,这就是我想出的,首先你能告诉我它是否正确,其次是我吗在我对结果做了一些事情后需要释放查询吗?
这是查询
$myquery= "select sum(total)
from
(
SELECT count(*) as total
FROM " .TABLE_PREFIX."tview v
where v.ipaddress = $ips
union all
SELECT count(*) as total
FROM " .TABLE_PREFIX."tview1 v1
where v1.ipaddress = $ips
union all
SELECT count(*) as total
FROM " .TABLE_PREFIX."tview3` v3
where v3.ipaddress = $ips
) src";
while ($row = mysql_fetch_array($myquery)) {
If($row !=0){
echo "NOT EMPTY";
}else{
echo "EMPTY";
}
}