<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:12pt"><DIV></DIV>
<DIV>How did I know that Earl would be the one to show me the error of my ways...</DIV>
<DIV> </DIV>
<DIV>Thanks, Earl that did the trick.<BR> </DIV>
<P><FONT face="bookman old style, new york, times, serif" color=#ff007f size=4><EM><STRONG>Nancy E. Wichmann, PMP</STRONG></EM></FONT></P>
<DIV><BR></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: Courier New, courier, monaco, monospace, sans-serif"><BR>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: arial, helvetica, sans-serif"><FONT face=Tahoma size=2>
<HR SIZE=1>
<B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B> Earl Miles <merlin@logrus.com><BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> development@drupal.org<BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Thu, April 8, 2010 2:21:28 PM<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> Re: [development] Strange query problem<BR></FONT><BR>On 4/8/2010 11:07 AM, nan wich wrote:<BR>> $query = "SELECT nc.nid, n.title, nc.daycount AS views, nc.totalcount, "<BR>> . "(SELECT COUNT(*) FROM {comments} c WHERE c.timestamp >= %d AND<BR>> c.nid=nc.nid) AS comments_today, "<BR>> . "cs.comment_count "<BR>> . "FROM {node_counter} nc "<BR>> . "INNER JOIN {node} n ON n.nid=nc.nid "<BR>> . "LEFT JOIN {node_comment_statistics} cs ON cs.nid=nc.nid "<BR>> . "WHERE nc.daycount > 0 "<BR>> . "ORDER BY nc.daycount
DESC";<BR>> $result = pager_query($query, $page_limit, 0, NULL, $today);<BR><BR>pager_query() is failing you because it can't rewrite that properly. You<BR>need to write your own count query for pager_query().<BR></DIV></DIV></div></body></html>