网站首页  |  业界新闻  |  技术文章  |  视频教程  |  下载频道  |  程序源码  |  个人空间  |  编程论坛
 
学习型 ASP/PHP/ASP.NET 主机 30元/年 全能 ASP/PHP/ASP.NET 主机,支持月付 专业 MSSQL 数据库空间,支持月付 专业 MySQL 数据库空间,支持月付
发新话题
打印

MYSQL怎么从几个结构相同的表里面查找一条记录

MYSQL怎么从几个结构相同的表里面查找一条记录

<?
$username=trim($_REQUEST["username"]);
$id=trim($_REQUEST["id"]);
$sql="select*from Bar_book union select*from Hotel_book union select*from Catering_book union select*from productionOther_book union select*from Company_book union select * from business_book union select * from Matchmaking_book union select * from outputOther_book union select * from Premises_book union select * from serviceOther_book where username='".$username."' and id='".$id."' order by id desc";
$resu=mysql_query($sql);
$res=mysql_fetch_array($resu);
$num=mysql_num_rows($resu);
if($res){
echo $num;
}
?>

返回的不是一个结果.江湖急救啊!

TOP

发新话题