BUG count breaks when having clause defined

This commit is contained in:
Aram Balakjian 2015-04-30 16:04:26 +01:00 committed by Daniel Hensby
parent e94c2a944e
commit be10d90cc5

View File

@ -1038,8 +1038,13 @@ class SQLQuery {
* @return int
*/
public function count( $column = null) {
// we can't clear the select if we're relying on its output by a HAVING clause
if(!empty($this->having)) {
$records = $this->execute();
return $records->numRecords();
}
// Choose a default column
if($column == null) {
elseif($column == null) {
if($this->groupby) {
$column = 'DISTINCT ' . implode(", ", $this->groupby);
} else {