Possible Bug ...

This line:

$this->num_results = $db->get_var(preg_replace("/SELECT.*FROM/Ui","SELECT count(*) FROM",$query));

... is the culprit. If you have a query with something like this ...

SELECT DISTINCT products.* FROM products,product_category_map WHERE products.product_id=product_category_map.products_id AND product_category_map.category_id=1

... it ends up dropping the products.* and you get count(*). This is devastating for the query because it causes the get_num_results() function to return all of the results from the category table (in my case 23) instead of just the matches (which should be just four).

Now, I don't know the answer to this quandry yet, but I will try and fix it and let ya'll know where I come out. Any help would be greatly appreciated.

Thanks!
Sean