Joomla Database - How to use LIMIT in getQuery?

前端 未结 4 1459
别跟我提以往
别跟我提以往 2021-02-04 02:42

I want to build the below query using joomla inbuilt database class.

SELECT * 
FROM table_name
ORDER BY id DESC
LIMIT 1

This is the query I hav

4条回答
  •  遇见更好的自我
    2021-02-04 03:22

    This should work as well:

    $query->setLimit(1);
    

    Documentation: http://api.joomla.org/cms-3/classes/JDatabaseQueryLimitable.html

提交回复
热议问题