Im using this direct query method in cakephp to get a count (against the norms of MVC).
$count = $this->History->query("SELECT count(id) AS x FROM ratings WHERE id='3' AND employee='28'");
But it turns out that, i need to use $count[0][0]['x'] to get the value.
Why isnt it available at $count['x']?
Simply, its because the function
does not return a single dimensional array. I will suggest you to create a
helper function, which extracts the single dimensional array and return it.then use it