CakePHP has an annoying habit of having very deep, multidimensional arrays when pulling data from the database.
For instance, I simply wanted to get the count of rows returned by a previous query using SQL_CALC_FOUND_ROWS and “SELECT FOUND_ROWS() as row_count”. The results were three arrays deep: $result[0][0][‘row_count’].
You can use
$this->Model->find('count');http://book.cakephp.org/view/1020/find-count?or rewrite query as
"select FOUND_ROWS() as TableName.row_count from tablename TableName"