[support] Pager Query D7

Ms. Nancy Wichmann nan_wich at bellsouth.net
Mon Oct 29 16:20:35 UTC 2012


Thanks, Jamie. No difference.
  $query = db_select('comment', 'c')->extend('PagerDefault')->limit($limit)->extend('TableSort');
  $query->innerJoin('users', 'u', 'u.uid = c.uid');
  $query->addField('u', 'name');
  $query->addField('u', 'uid');
  $query->addExpression('COUNT(*)', 'number');
  $query->groupBy('c.uid');
  $query->range(0, $limit);  
  $query->orderByHeader($table['header']);
  $result = $query->execute();
 I did look at node_admin_nodes() and don't see anything significantto tell me why theme_pager() isn't working for me. 

 
Nancy 

Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.



>________________________________
> From: Jamie Holly <hovercrafter at earthlink.net>
>To: support at drupal.org 
>Sent: Monday, October 29, 2012 12:01 PM
>Subject: Re: [support] Pager Query D7
> 
>
>When using extenders, the position of the extender is important. Check out:
>
>http://drupal.org/node/508796
>
>So make sure you have the ->extend right after your select.
      Then use your $query to do whatever other joins, conditions,
      fields, etc. you want. Put the limit in on that too. 
>
>You might want to check out node_admin_nodes() in node.admin.inc
      to get a better idea.
>
>Jamie Holly
http://www.intoxination.net 
http://www.hollyit.net
On 10/29/2012 11:49 AM, Ms. Nancy Wichmann wrote:
>
>I have a pager query ("$query = $query->extend('PagerDefault')->limit($limit);") coded and it is working fine. However, the theme('pager') is doing nothing. It returns a null string, so I am not getting a pager on the page. I have searched all over D.O, but am apparently missing the solution.
>>
>> 
>>Nancy
>>
  
>>Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.
>>
>>
>
>-- 
>[ Drupal support list | http://lists.drupal.org/ ]
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20121029/8be90e58/attachment-0001.html 


More information about the support mailing list