[development] Strange query problem
nan wich
nan_wich at bellsouth.net
Thu Apr 8 18:31:59 UTC 2010
How did I know that Earl would be the one to show me the error of my ways...
Thanks, Earl that did the trick.
Nancy E. Wichmann, PMP
________________________________
From: Earl Miles <merlin at logrus.com>
To: development at drupal.org
Sent: Thu, April 8, 2010 2:21:28 PM
Subject: Re: [development] Strange query problem
On 4/8/2010 11:07 AM, nan wich wrote:
> $query = "SELECT nc.nid, n.title, nc.daycount AS views, nc.totalcount, "
> . "(SELECT COUNT(*) FROM {comments} c WHERE c.timestamp >= %d AND
> c.nid=nc.nid) AS comments_today, "
> . "cs.comment_count "
> . "FROM {node_counter} nc "
> . "INNER JOIN {node} n ON n.nid=nc.nid "
> . "LEFT JOIN {node_comment_statistics} cs ON cs.nid=nc.nid "
> . "WHERE nc.daycount > 0 "
> . "ORDER BY nc.daycount DESC";
> $result = pager_query($query, $page_limit, 0, NULL, $today);
pager_query() is failing you because it can't rewrite that properly. You
need to write your own count query for pager_query().
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20100408/4f6a0ad2/attachment.html
More information about the development
mailing list