I know we can use
SQL_CALC_FOUND_ROWS and
FOUND_ROWS() like
PHP Code:
$this->db->select('SQL_CALC_FOUND_ROWS *', false);
// And get the result
$query = $this->db->query('SELECT FOUND_ROWS() AS `count`');
$totalRows = $query->row()->count;
But if we want to select the column by our own like
PHP Code:
$this->db->select('SQL_CALC_FOUND_ROWS *', false);
$this->db->select('a.name, b.age');
This will work but come out the sql string like
"SELECT SQL_CALC_FOUND_ROWS *, `a`.`name`, `b`.`age`", actually get everything from table a and table b, how to make it like
"SELECT SQL_CALC_FOUND_ROWS `a`.`name`, `b`.`age`"