So Back in march I made a modification to ezresults to fix a bug I found with the get_num_results function. The but was that when you used subqueries it would error out trying to figure out the number of results found and it wouldn't generate the navigation links. You can read it here:
http://www.woyano.com/view/1362/Ezresults--subqueries
When I wrote the article I knew that my way of fixing the problem wasn't the correct way to resolve the issue and was hoping that maybe someone would post with a better method. So 6 months later I ran into a problem once again building the navigation links and found out that the modifications I made were only useful when you did the subquery after the where portion of the query, not if the subquery was inbetween the initial "Select" and "From" so here is the only way I found out how to reslove the issue.
on line 622 you should see the following:
$this->num_results = $db->get_var(preg_replace("/SELECT.*FROM/Ui","SELECT count(*) FROM",$query));
or(if you made the changes from my earlier post)
$this->num_results = $db->get_var(preg_replace("/1-SELECT.*FROM/Ui","SELECT count(*) FROM","1-".$query));
comment out the line above and replace it with:
$db->query($query);
$this->num_results = $db->num_rows;
if there is a better way to do this please feel free to let me know.






2 Comments
Hey you know AdGuy always gets the last word! ;)