sql-calc-found-rows

cakephp and SQL_CALC_FOUND_ROWS

I am trying to add the SQL_CALC_FOUND_ROWS into a query (Please note this isn't for pagination) please note I am trying to add this to a cakePHP query the code I currently have is below: return $this->find('all', array( 'conditions' => $conditions, 'fields'=>array('SQL_CALC_FOUND_ROWS','Category.*','COUN...

How to use MySQL Found_Rows() in PHP?

I try to avoid doing Count() because of performance issue. (i.e. SELECT COUNT() FROM Users) If I run the followings in phpMyAdmin, it is ok: SELECT SQL_CALC_FOUND_ROWS * FROM Users; SELECT FOUND_ROWS(); It will return # of rows. i.e. # of Users. However, if I run in in PHP, I cannot do this: $query = 'SELECT SQL_CALC_FOUND...