当前位置:网站首页>织梦通过数据库查询调用当前文章的留言
织梦通过数据库查询调用当前文章的留言
2022-08-01 20:46:00 【网站建设影子】
通过数据库查询法进行代码如下
{dede:sql sql="SELECT a.username,a.msg FROM dede_feedback a where ischeck=1 and aid=~id~ ORDER BY id Desc LIMIT 0 , 3"} <li>[field:username function="(@me=='guest'? '游客' : @me)"/]:[field:msg/]</li>
{/dede:sql}代码说明
查询评织梦论表(dede_feedback)中的username和msg字段,查询条件为文章ID是当前文章的ID( aid=~id~ ),评论内容已经审核过(ischeck=1),并且排序为倒序排列就是最先评论的第一个显示(ORDER BY id Desc)只查询前3条评论内容(LIMIT 0 , 3)。
当然如果想调用头像,就是调用织梦feedback表中的face字段里的头像可以在上面查询数据库中加入一段a.face调用<img src=”[field:face/]”>;完整代码如下:
{dede:sql sql="SELECT a.username,a.msg,a.face FROM dede_feedback a where ischeck=1 and aid=~id~ ORDER BY id Desc LIMIT 0 , 3"} <li>[field:username function="(@me=='guest'? '游客' : @me)"/]:[field:msg/]</li>
{/dede:sql}边栏推荐
- Get started quickly with MongoDB
- Digital twin Beijing the imperial palace, yuan universe is the process of tourism
- 使用Huggingface在矩池云快速加载预训练模型和数据集
- 【节能学院】安科瑞餐饮油烟监测云平台助力大气污染攻坚战
- 【节能学院】数据机房中智能小母线与列头柜方案的对比分析
- iptables的使用简单测试
- Imitation cattle forum project
- 【Kaggle】House Prices
- Protocol Buffer usage
- LinkedList source code sharing
猜你喜欢

AQS原理和介绍

OSG笔记:设置DO_NOT_COMPUTE_NEAR_FAR,手动计算远近平面

Zheng Xiangling, Chairman of Tide Pharmaceuticals, won the "2022 Outstanding Influential Entrepreneur Award" Tide Pharmaceuticals won the "Corporate Social Responsibility Model Award"

有点奇怪!访问目的网址,主机能容器却不行

Excel advanced drawing techniques, 100 (22) - how to respectively the irregular data

】 【 nn. The Parameter () to generate and why do you want to initialize

虚拟机的IP地址自动变为127.0.0.1

仿牛客论坛项目

StringTable Detailed String Pool Performance Tuning String Concatenation

卷积神经网络(CNN)mnist数字识别-Tensorflow
随机推荐
tiup mirror
9月备考PMP,应该从哪里备考?
Little data on how to learn?Jida latest small learning data review, 26 PDF page covers the 269 - page document small data learning theory, method and application are expounded
【无标题】
基于FPGA的任意字节数(单字节、多字节)的串口(UART)发送(含源码工程)
Pytorch框架学习记录8——最大池化的使用
Which websites are commonly used for patent searches?
myid file is missing
模板特例化和常用用法
仿牛客论坛项目
[Personal Work] Remember - Serial Logging Tool
[Energy Conservation Institute] Ankerui Food and Beverage Fume Monitoring Cloud Platform Helps Fight Air Pollution
【多任务优化】DWA、DTP、Gradnorm(CVPR 2019、ECCV 2018、 ICML 2018)
密码学的基础:X.690和对应的BER CER DER编码
SIPp 安装及使用
【多任务模型】Progressive Layered Extraction: A Novel Multi-Task Learning Model for Personalized(RecSys‘20)
系统收集集
使用Huggingface在矩池云快速加载预训练模型和数据集
小数据如何学习?吉大最新《小数据学习》综述,26页pdf涵盖269页文献阐述小数据学习理论、方法与应用
【节能学院】智能操控装置在高压开关柜的应用