Further reduced duplicate code in the function that generates the where and having portion of the query.
Further reduced duplicate code in the function that generates the where and having portion of the query.

ruckbeard/php-database