Joomla Database - How to use LIMIT in getQuery?(Joomla 数据库 - 如何在 getQuery 中使用 LIMIT?)
问题描述
我想使用 joomla 内置数据库类构建以下查询.
I want to build the below query using joomla inbuilt database class.
这是我目前建立的查询.
This is the query I have built up to now.
我不知道如何将限制(LIMIT 1)添加到查询中.有人可以告诉我怎么做吗?谢谢
I don't know how to add the limit(LIMIT 1) to the query. Can someone please tell me how to do it? Thanks
推荐答案
早于 Joomla 3.0
$db->setQuery
函数接受 3 个参数.第一个是查询,然后是开始,然后是限制.我们可以限制记录,如上所示.
$db->setQuery
function takes 3 parameters. The first one being the query, then the start, then the limit. We can limit records as shown above.
如果你只想要一行
阅读更多
这篇关于Joomla 数据库 - 如何在 getQuery 中使用 LIMIT?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!