CDbException

CDbConnection failed to open the DB connection: SQLSTATE[HY000] [1049] Unknown database 'welfare'

C:\AppServ\www\welfare\framework\db\CDbConnection.php(398)

386                 throw new CDbException('CDbConnection.connectionString cannot be empty.');
387             try
388             {
389                 Yii::trace('Opening DB connection','system.db.CDbConnection');
390                 $this->_pdo=$this->createPdoInstance();
391                 $this->initConnection($this->_pdo);
392                 $this->_active=true;
393             }
394             catch(PDOException $e)
395             {
396                 if(YII_DEBUG)
397                 {
398                     throw new CDbException('CDbConnection failed to open the DB connection: '.
399                         $e->getMessage(),(int)$e->getCode(),$e->errorInfo);
400                 }
401                 else
402                 {
403                     Yii::log($e->getMessage(),CLogger::LEVEL_ERROR,'exception.CDbException');
404                     throw new CDbException('CDbConnection failed to open the DB connection.',(int)$e->getCode(),$e->errorInfo);
405                 }
406             }
407         }
408     }
409 
410     /**

Stack Trace

#7
+
 C:\AppServ\www\welfare\protected\controllers\DocumentController.php(56): CActiveRecord->findByPk("58")
51         $this->render('view', array(
52             'model' => $this->loadModel($id),
53         ));
54     }
55     public function actionDocload($id){
56        $doc = DocDocument::model()->findByPk($id);
57        $doc->document_load += 1;
58        $doc->saveCounters(array('document_load'=>1));
59        $file = $doc->document_file;
60 
61        $this->redirect(Yii::app()->baseUrl.'/document_files/'.$file);
#22
+
 C:\AppServ\www\welfare\index.php(13): CApplication->run()
08 defined('YII_DEBUG') or define('YII_DEBUG',true);
09 // specify how many levels of call stack should be shown in each log message
10 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
11 
12 require_once($yii);
13 Yii::createWebApplication($config)->run();
2024-03-28 15:57:29 Apache/2.4.25 (Win32) OpenSSL/1.0.2j PHP/5.6.30 Yii Framework/1.1.15-dev