count
```
$db->count();
```
@param  string $table
@param  array|string $wheres
@return int
@throws \RuntimeException
981
public function count(string $table, $wheres)
    {
        list($where, $bindings) = $this->handleWheres($wheres);
        $sql = "SELECT COUNT(*) AS total FROM {$table} WHERE {$where}";

        $result = $this->fetchObject($sql, $bindings);

        return $result ? (int)$result->total : 0;
    }
87046
public function GetCount($Wheres = '') {
      $this->_BeforeGet();
      
      $this->SQL
         ->Select('*', 'count', 'Count')
         ->From($this->Name);

      if (is_array($Wheres))
         $this->SQL->Where($Wheres);

      $Data = $this->SQL
         ->Get()
         ->FirstRow();

      return $Data === FALSE ? 0 : $Data->Count;
   }
94858
public int count(Connection conn, Entity where) throws SQLException {
		checkConn(conn);
		
		final Query query = new Query(SqlUtil.buildConditions(where), where.getTableName());
		PreparedStatement ps = null;
		try {
			ps = dialect.psForCount(conn, query);
			return SqlExecutor.query(ps, new NumberHandler()).intValue();
		} catch (SQLException e) {
			throw e;
		} finally {
			DbUtil.close(ps);
		}
	}
322053
public function countAll($column = '*')
    {
        $results = $this->db->get($this->table, NULL, $column);

        return (int) count($results);
    }
715921
public function getAge(Tables $tables): int
    {
        return $tables->getRacesTable()->getAge($this->getRaceCode(), $this->getSubRaceCode());
    }
1215192
public function fetchCount($where=array()) {
        $obj = $this->getConnection();
        if (empty($where) == false) {
            foreach ($where as $key => $value) {
                $obj->where($key, $value);
            }
        }
        $count = $obj->getValue($this->getDao()->getTableName(), 'count(1)');
        return (int)$count;
	}
913484
public function count( $conditions = array() )
	{
		$conditions	= $this->getConditionQuery( $conditions, FALSE, TRUE, TRUE );					//  render WHERE clause if needed, foreign cursored, allow functions
		$conditions	= $conditions ? ' WHERE '.$conditions : '';
		$query	= 'SELECT COUNT(`%s`) as count FROM %s%s';
		$query	= sprintf( $query, $this->primaryKey, $this->getTableName(), $conditions );
		return (int) $this->dbc->query( $query )->fetch( \PDO::FETCH_OBJ )->count;
	}
1266563
public function countResult($wheres = [], $selectField = '*')
    {
        if (!is_array($selectField)) {
            $selectField = [$selectField];
        }
        $db = $this->db->select($selectField)->from($this->table);
        if (is_array($wheres) && count($wheres) > 0) {
            foreach ($wheres as $field => $value) {
                if (is_array($value)) {
                    $db->whereIn($field, $value);
                } else {
                    $db->where($field, self::OPERATOR_EQUAL_TO, $value);
                }
            }
        } else {
            $db->where($this->primaryKey, self::OPERATOR_EQUAL_TO, $wheres);
        }
        $totalItem = $db->execute()->rowCount();
        $this->debug->debug(__FUNCTION__, 'Total Item Result => ' . json_encode($totalItem));

        return $totalItem;
    }
214959
public int count(String where, String[] args) {
		return db.count(getTableName(), where, args);
	}
630841
public function update($data = [], $wheres = [])
    {
        if (is_array($wheres) && count($wheres) > 0) {
            foreach ($wheres as $column => $column_value) {
                if (is_array($column_value)) {
                    $this->db->where($column, $column_value, self::OPERATOR_IS_IN);
                } else {
                    $this->db->where($column, $column_value, self::OPERATOR_EQUAL_TO);
                }
            }
        }
        if ($this->db->update($this->table, $data)) {
            return (int) $this->db->count;
        }

        return 0;
    }
584038
public static function countWhere (string $column, array $operatorValue, string $joinOperator="AND") : int
	{
		$joinOperator 	= static::validateOperator($joinOperator, "AND");
		$expression 	= static::generateValue($column, $operatorValue, $joinOperator);
		$sqlQuery  		= "SELECT COUNT(*) as count FROM ".static::$tableName." WHERE {$column} {$expression}";
		$resultSet 		= Database::getInstance()->query($sqlQuery);
		$row 			= Database::fetchAssoc($resultSet);
		return (int) array_shift($row);
	}
1283394
public static function count($table, $condition, $field = '1')
    {
        $db = self::Using(self::$using_dbo_id);
        return $db->count($table, $condition, $field);
    }
241075
public function count($table, $condition = false, $group = false, $rows = false)
	{
        Eresus_Kernel::log(__METHOD__, LOG_NOTICE, 'This method is deprecated');
		$q = Eresus_DB::getHandler()->createSelectQuery();
		$e = $q->expr;

		$q->select($q->alias($e->count('*'), 'count'));
        $q->from($table);

		if ($condition)
		{
			$q->where($condition);
		}

		if ($group)
		{
			$q->groupBy($group);
		}

		$result = $q->fetchAll();
		if ($rows)
		{
			return count($result);
		}
		else
		{
			return intval($result[0]['count']);
		}
	}
354423
final public function delete($table, $where=[]) {
		$stmt = "DELETE FROM $table";
		if ($where) {
			$pair_wheres = [];
			$params = [];
			foreach ($where as $key => $val) {
				$pair_wheres[] = "{$key}=?";
				$params[] = $val;
			}
			$stmt .= " WHERE " . implode(" AND ", $pair_wheres);
		}

		self::$logger->info(sprintf(
			"SQL: delete ok: %s <- '%s'.",
			$stmt, json_encode($where)));

		$this->prepare_statement($stmt, $params);
	}
1178724
public function delete($where, $table = null)
    {
        $table = ($table) ?: $this->getTable();
        $sql = $this->getSql();
        $delete = $sql->delete($table);

        $delete->where($where);

        $statement = $sql->prepareStatementForSqlObject($delete);
        $result = $statement->execute();

        return $result->getAffectedRows();
    }
482903
public function countAllResults(string $table='', bool $reset = TRUE): int
	{
		// Set the table
		if ( ! empty($table))
		{
			$this->from($table);
		}

		$result = $this->_run('get', $table, NULL, NULL, $reset);
		$rows = $result->fetchAll();

		return (int) count($rows);
	}
1065190
protected function generate_count_records_sql(string $wheresql = null) : string {
        $alias = $this->get_table_alias();
        $db = $this->get_db();

        $selectsql = "SELECT COUNT(1) FROM {" . self::TABLE . "} {$alias}";
        $selectsql .= $wheresql ? ' WHERE ' . $wheresql : '';

        return $selectsql;
    }