pbootcms模板网站{pboot:sql sql="语句"}[sql:字段]{/pboot:sql}万能循环标签使用介绍!熟悉PbootCMS手册是使用本程序开发模板的前提,虽然我们尽可能把所有标签做到简单到想哭,但是还是需要您静下心来好好看看!
PbootCMS V3.0.4 build 2021-02-14版本新增了{pboot:sql sql=”语句”}[sql:字段]{/pboot:sql}万能循环标签。
实测支持多表联合查询,速度OK,下面来看下群友分享的使用代码:
{pboot:sql sql="select pb_content.*, pb_content_sort.name from pb_content_sort,pb_content"}<a href="[sql:id]" rel="external nofollow" rel="external nofollow" >[sql:title] [sql:name]</a>{/pboot:sql}
{pboot:sql sql="select ay_content.*, ay_content_sort.<?php echo "mcode";?> from ay_content_sort,ay_content"}<a href="[sql:id]" rel="external nofollow" rel="external nofollow" >[sql:title] [sql:<?php echo "mcode";?>]</a>{/pboot:sql}
pb的这个新标签可以说非常强大,不过一般建站中用不到,用到时可参考以上。
更多pbootcms教程请前往: