I am trying to run a query in AppController on a table that has no Model associated with it. I don\'t want to use a Model cause this query would fire on every request and I gues
you should run this way
App::uses('ConnectionManager', 'Model'); $db = ConnectionManager::getDataSource('default'); if (!$db->isConnected()) { $this->Session->setFlash(__('Could not connect to database.'), 'default', array('class' => 'error')); } else { $db->rawQuery($some_sql); }