Categories

count_all_results() and get_where() in CodeIgniter

This silly little mistake tripped me up for a bit this morning and I only figured it out after some searching. Based on the results I’m not the only person that has hit this roadblock, so here is the solution.

I was doing a normal query that looked something like this:

$read_db = $this->load->database(‘read’, TRUE);
$query = $read_db->get_where(array(‘username’ [...]