function toSql($strwhere = null, $strorderby = null, $strhaving = null, $oneRecordMode = false, $joinFromPart = null) { $sql = SQLQuery::toSql($strwhere); if($this->HasGroupBy()) { $ret = 'select count(*) from (' . $sql . ') a'; } else { // sql variable begins with 'FROM ...' cause // we dropped out everything before it in constructor. // Therefore we may not use subqueries. $ret = 'select count(*) from ' . $sql; } return $ret; }
function toSql($where) { $sql = SQLQuery::toSql($where); if ($this->HasGroupBy()) { $ret = 'select count(*) from (' . $sql . ') a'; } else { // sql variable begins with 'FROM ...' cause // we dropped out everything before it in constructor. // Therefore we may not use subqueries. $ret = 'select count(*) from ' . $sql; } return $ret; }