$sql_str.=" and ( to_days(indate_1)-to_days(now()) = 1 ) "; $sql_search = "select 'lb_zhibo_lanqiu' tbname,lb_zhibo_lanqiu.* from lb_zhibo_lanqiu where pass='1' ".$sql_str." union all select 'lb_zhibo_zuqiu' tbname,lb_zhibo_zuqiu.* from lb_zhibo_zuqiu where pass='1' ".$sql_str." order id"; $result = $mysqli->query($sql_search); while ($rs = $result->fetch_assoc()) { ?> <div class="pl_box"> <div class="pl_nicheng"><?=$rs["nicheng"]?></div> <div class="pl_message"><?=$rs["tbname"]?></div> </div> <? } to_days函数 //其中 $rs["tbname"] 就是输出当前数据是哪个数据表
以上就是两表同时检索、查询今天,明天,后天数据的详细内容,更多关于两表同时检索、查询今天,明天,后天数据的资料请关注九品源码其它相关文章!