1、数据库中有内容而页面提示 未搜索到任何数据
解决方案:
在前半部分添加一个标签 scode=*
代表搜索所有栏目内容
{pboot:search num=12 order=sorting scode=* field='title|content'} {/pboot:search}
简单搜索代码示例
<form action="{pboot:scaction}" method="get"> 关键字:<input type="text" name="keyword" > <button type="submit">搜索</button> </form>
多条件搜索代码示例
可以通过隐藏字段,指定搜索的栏目
<form action="{pboot:scaction}" method="get"> 内容:<input type="text" name="content" > 标题:<input type="text" name="title" > 作者:<input type="text" name="author" > <input type="hidden" name="scode" value="2,3" > <button type="submit">搜索</button> </form>
搜索结果列表
{pboot:search} <a href="search:link">search:title</a> {/pboot:search}
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。