CDbException

CDbConnection failed to open the DB connection: SQLSTATE[HY000] [2002] No route to host

/var/www/Public/scholarship/protected/models/PhAddressProvince.php(29)

17      * @return PhAddressProvince the static model class
18      */
19     public static function model($className=__CLASS__)
20     {
21         return parent::model($className);
22     }
23 
24     /**
25      * @return CDbConnection database connection
26      */
27     public function getDbConnection()
28     {
29         return Yii::app()->db_phaddress;
30     }
31 
32     /**
33      * @return string the associated database table name
34      */
35     public function tableName()
36     {
37         return 'phaddress2.province';
38     }
39 
40     /**
41      * @return array validation rules for model attributes.

Stack Trace

#4
+
 /var/www/Public/scholarship/protected/models/PhAddressProvince.php(29): CModule->__get("db_phaddress")
24     /**
25      * @return CDbConnection database connection
26      */
27     public function getDbConnection()
28     {
29         return Yii::app()->db_phaddress;
30     }
31 
32     /**
33      * @return string the associated database table name
34      */
#7
+
 /var/www/Public/scholarship/protected/views/report/index.php(38): CActiveRecord->findAll()
33 )); ?>
34 <?php //$employeeList=CHtml::listData(Employee::model()->findAll(),'id','fullName');?>
35         <?php //echo $form->dropDownList($model,'employeeId', $employeeList); ?>
36 <label>Province Name: </label>
37 
38 <?php $provinces=CHtml::listData(PhAddressProvince::model()->findAll(),'id','name');?>
39 <?php echo $form->dropDownList($modelProvince,'name', $provinces);?>
40     <!--div class="row buttons"-->
41         <?php echo CHtml::submitButton('View',array('class'=> 'btn btn-danger')); ?>
42     <!--/div-->
43 
#12
+
 /var/www/Public/scholarship/protected/controllers/ReportController.php(89): CController->render("index", array("modelTracer" => Tracer, "modelProvince" => PhAddressProvince))
84         if(isset($_POST['Tracer'])){
85             $tracerReportId=$_POST['Tracer']['tracerReportName'];
86             $this->redirect(array('tracer/list','tracerReportId'=>$tracerReportId));
87         }        
88         
89         $this->render('index', array('modelTracer'=>$modelTracer, 'modelProvince'=>$modelProvince));
90     }
91     
92     public function actionStatus()
93     {
94         $model=new Scholar;
2024-03-28 13:22:08 Apache/2.4.29 (Ubuntu) Yii Framework/1.1.22-dev