我想知道是否有办法用限制和limitstart等来回显整个查询.我可以回应行$query,但是我想知道为什么限制不起作用,我似乎无法得到它以显示它发送到数据库的实际查询.这里是代码:
原文链接:https://www.f2er.com/php/131665.html$params =& JComponentHelper::getParams('com_news'); $limit = $params->get('x_items',5); $limitstart = JRequest::getVar('limitstart',0); $query = "SELECT * FROM #__news WHERE published = 1 AND catid = ".$Itemid." ORDER BY date DESC"; $db->setQuery($query,$limitstart,$limit); $rows = $db->loadObjectList();
$db-> getQuery($query,$limit);只显示“SELECT * FROM jos_news WHERE published = 1 AND catid = 8 ORDER BY date DESC”,它在查询结尾没有LIMIT参数.
任何帮助将不胜感激:)