public function count_all($table = '')
{
if ($table === '') {
return 0;
}
$query = $this->query($this->_count_string . $this->escape_identifiers('numrows') . ' FROM ' . $this->protect_identifiers($table, TRUE, NULL, FALSE));
if ($query->num_rows() === 0) {
return 0;
}
$query = $query->row();
$this->_reset_select();
return (int) $query->numrows;
}