标题包含关键字
①、比较粗糙的匹配,可能不太精确:title like '%$navinfor[keyboard]%'
②、精确的匹配,比较消耗资源:title regexp '(^|,)$navinfor[keyboard]($|,)'
关键字相同
①、比较粗糙的匹配,可能不太精确:keyboard like '%$navinfor[keyboard]%'
②、精确的匹配,比较消耗资源:keyboard regexp '(^|,)$navinfor[keyboard]($|,)'
格式1、
①、模糊匹配
[e:loop={"select * from phome_ecms_news where title like '%$navinfor[keyboard]%' or keyboard like '%$navinfor[keyboard]%' order by id desc limit 10",0,24,0}]
<a href="<?=$bqsr['titleurl']?>" target="_blank"><?=$bqr['title']?></a> <br>
[/e:loop]
②、精确的匹配
[e:loop={"select * from phome_ecms_news where title regexp '(^|,)$navinfor[keyboard]($|,)' or keyboard regexp '(^|,)$navinfor[keyboard]($|,)' order by id desc limit 10",0,24,0}]
<a href="<?=$bqsr['titleurl']?>" target="_blank"><?=$bqr['title']?></a> <br>
[/e:loop]
格式2、
①、模糊匹配
[e:loop={'news',10,3,0,"keyboard like '%$navinfor[keyboard]%' or title like '%$navinfor[keyboard]%'",''}]
<li>·<a href="<?=$bqsr['titleurl']?>" target="_blank"><?=esub($bqr[title],24)?></a></li>
[/e:loop]
或
[e:loop={0,10,3,0,"keyboard like '%$navinfor[keyboard]%' or title like '%$navinfor[keyboard]%'",''}]
<a href="<?=$bqsr['titleurl']?>" target="_blank"><?=$bqr['title']?></a> <br>
[/e:loop]
注意:在没有相关文章时,会调用最新的文章来替代空缺的位置
①、比较粗糙的匹配,可能不太精确:title like '%$navinfor[keyboard]%'
②、精确的匹配,比较消耗资源:title regexp '(^|,)$navinfor[keyboard]($|,)'
关键字相同
①、比较粗糙的匹配,可能不太精确:keyboard like '%$navinfor[keyboard]%'
②、精确的匹配,比较消耗资源:keyboard regexp '(^|,)$navinfor[keyboard]($|,)'
格式1、
①、模糊匹配
[e:loop={"select * from phome_ecms_news where title like '%$navinfor[keyboard]%' or keyboard like '%$navinfor[keyboard]%' order by id desc limit 10",0,24,0}]
<a href="<?=$bqsr['titleurl']?>" target="_blank"><?=$bqr['title']?></a> <br>
[/e:loop]
②、精确的匹配
[e:loop={"select * from phome_ecms_news where title regexp '(^|,)$navinfor[keyboard]($|,)' or keyboard regexp '(^|,)$navinfor[keyboard]($|,)' order by id desc limit 10",0,24,0}]
<a href="<?=$bqsr['titleurl']?>" target="_blank"><?=$bqr['title']?></a> <br>
[/e:loop]
格式2、
①、模糊匹配
[e:loop={'news',10,3,0,"keyboard like '%$navinfor[keyboard]%' or title like '%$navinfor[keyboard]%'",''}]
<li>·<a href="<?=$bqsr['titleurl']?>" target="_blank"><?=esub($bqr[title],24)?></a></li>
[/e:loop]
或
[e:loop={0,10,3,0,"keyboard like '%$navinfor[keyboard]%' or title like '%$navinfor[keyboard]%'",''}]
<a href="<?=$bqsr['titleurl']?>" target="_blank"><?=$bqr['title']?></a> <br>
[/e:loop]
注意:在没有相关文章时,会调用最新的文章来替代空缺的位置
- 上一篇:帝国CMS的熊掌号怎么配置
- 下一篇:WCDP换服务器数据还原全过程
我们凭借多年的网站建设经验,坚持以“帮助中小企业实现网络营销化”为宗旨,累计为4000多家客户提供品质建站服务,得到了客户的一致好评。如果您有网站建设、网站改版、域名注册、主机空间、手机网站建设、网站备案等方面的需求...
请立即点击咨询我们或拨打咨询热线: 18261116466,我们会详细为你一一解答你心中的疑难。项目经理在线
请立即点击咨询我们或拨打咨询热线: 18261116466,我们会详细为你一一解答你心中的疑难。项目经理在线