<?php
class Count{
    private $db;

    public function __construct() {
        $this->db = DBConnectorFactory::loadDriver();
    }

    public function countRows($table, $cond = ' ') {
        $query = $this->db->query('SELECT count(*) as count FROM ' . $table.' '.$cond);
        return $this->db->assoc($query)['count'];
    }

}	