I am trying to use theme_pager to create pagination as below, but pagination does not appear. I have tried using var_dump(theme('pager', NULL, 10))
and the result is NULL
.
$q="SELECT DISTINCT(node.nid) AS nid, node.type AS node_type, node.vid AS node_vid, node.title AS node_title, node.language AS node_language, node.created AS node_created, node_revisions.teaser AS node_revisions_teaser, node_revisions.format AS node_revisions_format FROM node node LEFT JOIN node_revisions node_revisions ON node.vid = node_revisions.vid WHERE (node.type in ('slideshow')) AND (node.status <> 0) AND (node.language='$lang') GROUP BY nid ORDER BY node_created DESC";
$result = pager_query($q, 10, 0);
//Process data.
return $output . theme('pager', NULL, 10);
also i tried to simplify the query and to make it from one table as below, but this didn't work as well
SELECT nid, title, language, created FROM node WHERE node.type='slideshow' AND node.status 0 AND node.language='en' ORDER BY created DESC
Any idea is highly appreciated!