Using mysql_query() within CakePHP


I always wanted to be able to get large datasets into CakePHP but since cake turns a 10MB db result into 120MB array, I had to come up with a solution to use the php mysql_query() function.

After a few unhelpful searches on google this is what I ended up with:

1
2
$db =& ConnectionManager::getDataSource('default');
3
$result = mysql_query('SELECT * FROM `users`;', $db->connection);
4

  1. #1 by Robson on September 11, 2013 - 1:26 pm

    Very Good! Thanks!

  2. #2 by vinod on November 12, 2013 - 2:07 am

    hello

    i have use this code as it is. the error show
    ConnectionManager class not define may i wrong any where.Please let me know.

  3. #3 by vinod on November 12, 2013 - 2:08 am

    i have use this code as it is. the error show
    ConnectionManager class not define may i wrong any where.Please let me know.

(will not be published)