CDbException

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

/data/travel_from_112_124_34_134/travel/front/protected/modules/user/models/Member.php(22)

10     * Returns the static model of the specified AR class.
11     * @param string $className active record class name.
12     * @return Content the static model class
13     */
14     public static function model($className = __CLASS__) {
15         return parent::model($className);
16     }
17 
18     /**
19     * @return string the associated database table name
20     */
21     public function tableName() {
22         return Yii::app()->dbu->tablePrefix.'member';
23     }
24 
25     /**
26     * 添加数据
27     * @return void
28     */
29     public function add($data) {
30         $command = parent::$dbu->createCommand();
31         try {
32             $command->insert(self::model()->tableName(),$data);
33             return Yii::app()->dbu->getLastInsertId();
34         }catch (Exception $e) {

Stack Trace

#4
+
 /data/travel_from_112_124_34_134/travel/front/protected/modules/user/models/Member.php(22): CModule->__get("dbu")
17 
18     /**
19     * @return string the associated database table name
20     */
21     public function tableName() {
22         return Yii::app()->dbu->tablePrefix.'member';
23     }
24 
25     /**
26     * 添加数据
27     * @return void
#7
+
 /data/travel_from_112_124_34_134/travel/front/protected/modules/user/models/Member.php(15): CActiveRecord::model("Member")
10     * Returns the static model of the specified AR class.
11     * @param string $className active record class name.
12     * @return Content the static model class
13     */
14     public static function model($className = __CLASS__) {
15         return parent::model($className);
16     }
17 
18     /**
19     * @return string the associated database table name
20     */
#8
+
 /data/travel_from_112_124_34_134/travel/front/protected/modules/show/models/Comment.php(144): Member::model()
139         $res = $this->get($params);
140         return $res;
141     }
142 
143     public function get($params){
144         $sql = " FROM ".self::model()->tableName()." AS c LEFT JOIN ".Member::model()->tableName()." AS m";
145         $sql .= " ON c.user_id = m.id WHERE c.status = 1 AND c.parent_id = 0";
146         if(!empty ($params['contentId'])){
147             $sql .= " AND c.content_id = {$params['contentId']}";
148         }
149         if(!empty($params['or_type'])) {
2024-03-19 14:21:51 nginx/1.0.4 Yii Framework/1.1.10