Your Ad Here

Posted By

theroamingcoder on 03/29/10


Tagged

mysql drupal pagerquery


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

mgerdt


Get row count from MySQL query


 / Published in: SQL
 

This trick is useful in scenarios where you already have a count in the SELECT along with a GROUP BY that is preventing you from getting a total count of the rows returned. Great for use in the $countquery parameter of pagerquery() function calls in Drupal.

  1. SELECT count(1) FROM (
  2. -- YOUR QUERY HERE
  3. ) AS countable

Report this snippet  

You need to login to post a comment.