PHPFusion\Database\Driver\PDOMySQL::count PHP Метод

count() публичный Метод

Count the number of rows in a table filtered by conditions
public count ( string $field, string $table, string $conditions = "", array $parameters = [] ) : integer
$field string Parenthesized field name
$table string Table name
$conditions string conditions after "where"
$parameters array
Результат integer
    public function count($field, $table, $conditions = "", array $parameters = array())
    {
        $cond = $conditions ? " WHERE " . $conditions : "";
        $sql = "SELECT COUNT" . $field . " FROM " . $table . $cond;
        $statement = $this->query($sql, $parameters);
        return $statement ? $statement->fetchColumn() : FALSE;
    }