Welcome Guest, Not a member yet? Register   Sign In
Does CI3 db object offer SQL_CALC_FOUND_ROWS functionality?
#1

So I have a crazy search that shows paginated results. Obviously, it's extra work to have to create one query for the search and another just to get the number of TOTAL results. Does the CI3 db class provide any similar sort of functionality to SQL_CALC_FOUND_ROWS?

What does everyone think about the suggestion here on the old forum which suggests this:
Code:
$this->db->select("SQL_CALC_FOUND_ROWS *", FALSE); // Second param disables escaping and allows SQL_CALC_FOUND_ROWS to work/code]
And then
[code] $total = $this->db->query("SELECT FOUND_ROWS()")->row(0)->{"FOUND_ROWS()"};
Reply




Theme © iAndrew 2016 - Forum software by © MyBB