$query_rs .= "SELECT * FROM biweb_news WHERE title LIKE ''%biweb%''
OR content LIKE ''%biweb%'' UNION SELECT * FROM biweb_user WHERE title LIKE
''%biweb%'' OR content LIKE ''%biweb%'' ORDER BY submit_date DESC";

使用UNION可以把多个select的结果集合并后,进行排序,可以轻松实现多表查询结果合并。

ArthurXF倾情奉献!
PHP | 评论(0) | 引用(0) | 阅读(14429)
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]