Dealing with Parentheses in Codeigniter Queries
Bingo!! I have added the following line before I passed the variable $owner
to the query and it worked,
$owner = html_entity_decode($owner);
Have you tried doing select sum(db.[count] as icount because in the language count could be a reserved word as well. so bracket the field or rename it, try to not name the new output as count..