public function count_records($table, array $conditions=null) {
        list($select, $params) = $this->where_clause($table, $conditions);
        return $this->count_records_select($table, $select, $params);
    }
public function count_records($table, array $conditions=null) {
        list($select, $params) = $this->where_clause($table, $conditions);
        return $this->count_records_select($table, $select, $params);
    }
public function count_records ( $ table , array $ conditions = null ) { list ( $ select , $ params ) = $ this -> where_clause ( $ table , $ conditions ) ; return $ this -> count_records_select ( $ table , $ select , $ params ) ; }
Count the records in a table where all the given conditions met.

@param string $table The table to query.
@param array $conditions optional array $fieldname=>requestedvalue with AND in between
@return int The count of records returned from the specified criteria.
@throws dml_exception A DML specific exception is thrown for any errors.
Count the records in a table where all the given conditions met .