标题:MYSQL怎么从几个结构相同的表里面查找一条记录
只看楼主
hejingke
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2007-5-26
 问题点数:0 回复次数:0 
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;
}
?>

返回的不是一个结果.江湖急救啊!
搜索更多相关主题的帖子: MYSQL 结构 记录 
2008-05-07 17:17



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-212995-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.275403 second(s), 7 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved