CDbException

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

/var/www/html/com.fydyyw.www/web/protected/extensions/CPub/CDB.php(94)

082         return $tempData;
083     }
084     /**
085      * 数据库句柄
086      *
087      * @param unknown $dbhandle
088      *            为空:本地配置
089      *            boyang:博扬
090      *            boyue:博跃
091      */
092     private static function getDBHandle($dbhandle) {
093         if (CCheck::isEmpty ( $dbhandle )) {
094             return Yii::app ()->db;
095         }
096         if ($dbhandle == 'boyang') {
097             return Yii::app ()->db_boyang;
098         }
099         if ($dbhandle == 'boyue') {
100             return Yii::app ()->db_boyue;
101         }
102     }
103 
104     /**
105      * SQL语句增删改批处理语句,即:一次执行多条SQL时,使用此方法
106      *

Stack Trace

#4
+
 /var/www/html/com.fydyyw.www/web/protected/extensions/CPub/CDB.php(94): CModule->__get("db")
89      *            boyang:博扬
90      *            boyue:博跃
91      */
92     private static function getDBHandle($dbhandle) {
93         if (CCheck::isEmpty ( $dbhandle )) {
94             return Yii::app ()->db;
95         }
96         if ($dbhandle == 'boyang') {
97             return Yii::app ()->db_boyang;
98         }
99         if ($dbhandle == 'boyue') {
#5
+
 /var/www/html/com.fydyyw.www/web/protected/extensions/CPub/CDB.php(136): CDB::getDBHandle("")
131      *
132      * @param unknown $sql
133      * @return unknown 查询对象 二维数组,如果查询的结果集记录数为0,则数组长度为0
134      */
135     public static function queryAll($sql, $dbhandle = '') {
136         $connection = CDB::getDBHandle ( $dbhandle ); // 获取数据库链接
137         $command = $connection->createCommand ( $sql );
138         $data = $command->queryAll ();
139         return $data;
140     }
141 
#6
+
 /var/www/html/com.fydyyw.www/web/protected/modules/index/models/MsgSearchModel.php(100): CDB::queryAll(" select * from fyd_ad_area a , fyd_ad_content b where a.area_i...")
095 //            $limit = " limit 0 , 6 ";
096 //        }
097             $sql = " select *  from  fyd_ad_area a , fyd_ad_content b where a.area_id = b.area_id  and a.area_id = '" . $type . "' 
098             and a.area_type = $num  and  b.ad_id = $ad AND b.status=1  order by content_sort  asc  limit  $limit , $limits " ;
099 
100             return CDB::queryAll ( $sql );
101     }
102 
103     /**
104      * 医药资讯 首页部分
105      */
2024-03-19 19:31:48 nginx/1.16.0 Yii Framework/1.1.16