CDbException

CDbConnection failed to open the DB connection: SQLSTATE[08004] [1040] Too many connections

S:\WebSites\WinPredict\Prod\Site\WebSite\content\protected\components\Api.php(835)

823 
824         if (!empty($get_json)) {
825             $result = json_decode($get_json);
826         }
827 
828         return $result;
829     }
830 
831     // Get Predictors
832     public function getPredictors($filter, $PredictorId = null) {
833 
834         $result = '';
835         if (!Yii::app()->user->id) {
836             $filter['userId'] = 'null';
837         } else {
838             $filter['userId'] = Yii::app()->user->id;
839         }
840 
841         $ParamUrl = '';
842         if ($filter) {
843             $ParamUrl = $this->setParam($filter);
844         }
845 
846         $get_json = $this->rest->get('/api/v1/predictors/' . $PredictorId . $ParamUrl);
847 

Stack Trace

#11
+
 S:\WebSites\WinPredict\Prod\Site\WebSite\content\protected\modules\auth\components\AuthWebUser.php(29): CWebUser->init()
24     /**
25      * Initializes the component.
26      */
27     public function init()
28     {
29         parent::init();
30         $this->setIsAdmin(in_array($this->name, $this->admins));
31     }
32 
33     /**
34      * Returns whether the logged in user is an administrator.
#14
+
 S:\WebSites\WinPredict\Prod\Site\WebSite\content\protected\components\Api.php(835): CModule->__get("user")
830 
831     // Get Predictors
832     public function getPredictors($filter, $PredictorId = null) {
833 
834         $result = '';
835         if (!Yii::app()->user->id) {
836             $filter['userId'] = 'null';
837         } else {
838             $filter['userId'] = Yii::app()->user->id;
839         }
840 
#15
+
 S:\WebSites\WinPredict\Prod\Site\WebSite\content\protected\controllers\PredictorsController.php(91): Api->getPredictors(null, "12924")
86 
87     public function actionView($id) {
88         
89         $webApi = new Api();
90 
91         $data = $webApi->getPredictors(null, $id);
92 
93         if ($data == null) {
94             $this->redirect('/predictors');
95             //throw new CHttpException(404, 'The requested page does not exist.');
96         }
2024-04-18 21:32:54 Microsoft-IIS/7.5 Yii Framework/1.1.15
CDbConnection failed to open the DB connection: SQLSTATE[08004] [1040] Too many connections