1Next >
| pktsandy | 发表于:11-11-07 12:57 编辑于:11-07 12:59 [添加收藏] 楼主 [回复] #Top# |
|---|---|
![]() ![]() ![]() ![]()
人气:1181
积分:3438
金币:29313
|
例如以下SQL: select * from(select listid,kid from kcest.king__article where nshow=1 and ktag like '%ni ma%' order by ndate desc) as tmp_article UNION ALL select * from(select listid,kid from %s__product where nshow=1 and ktag like '%ni ma%' order by ndate desc) as tmp_product UNION ALL select * from(select listid,kid from %s__shop where nshow=1 and ktag like '%ni ma%' order by ndate desc) as tmp_shop UNION ALL select * from(select listid,kid from %s__bbs where nshow=1 and ktag like '%ni ma%' order by ndate desc) as tmp_bbs limit 0,10private function filterTablePrefix($sql){if(!strpos($sql,'like')) return $sql; preg_match('/(%w+%)/',$sql,$word);$s_=str_replace($word[1],'#word',$sql); $s=preg_replace('/(%s_)(w+)/',DB_PREFIX.'_$2',$s_);$sql=str_replace('#word',$word[1],$s);return $sql;}$this->link==0 && $this->connect();//判断数据库连接是否可用$_str=$this->filterTablePrefix($_str);{king:portal type="tag" modelid="1" number="10" orderby="ndate desc"} <p><strong><a href="{king:path/}">{king:title/}</a></strong></p>{/king:portal}
Ta最近还发表过
[分享]
MYSQL5.5的中文手册
(19-03-22)
[分享]
留言的修改版
(18-02-26)
[分享]
KC PHP源代码剖析(慢慢补充)
(16-02-18)
[使用]
新闻内容页的分页
(14-08-24)
[使用]
货栈评论JS动态翻页
(13-11-08)
随机阅读
[其他]
现在有哪些朋友在用K9,发来看下
(15-05-03)
[疑问]
首次安装出现这个是怎么回事?
(14-07-05)
[分享]
KingCMS5.0 初级入门教程
(12-02-13)
[其他]
做网站前你得考虑的几个问题
(11-10-05)
[疑问]
新闻上一篇下一篇的链接
(11-06-20)
|
1Next >