Database Err: SQLSTATE[42000] [1203] User shangpu already has more than 'max_user_connections' active connections
- D:\wwwroot\shangpu\wwwroot\protected\include\core.php on line 352
347.
{
348.
if($force_replace || empty($GLOBALS['instance']['mysql'][$db_config_key]))
349.
{
350.
try{
351.
$GLOBALS['instance']['mysql'][$db_config_key] = new PDO('mysql:dbname='.$db_config['MYSQL_DB'].';host='.$db_config['MYSQL_HOST'].';port='.$db_config['MYSQL_PORT'], $db_config['MYSQL_USER'], $db_config['MYSQL_PASS'], array(PDO::MYSQL_ATTR_INIT_COMMAND=>'SET NAMES \''.$db_config['MYSQL_CHARSET'].'\''));
352.
353.
}catch(PDOException $e){err('Database Err: '.$e->getMessage());}
}
354.
return $GLOBALS['instance']['mysql'][$db_config_key];
355.
}
356.
357.
private function _where($conditions)
- D:\wwwroot\shangpu\wwwroot\protected\include\core.php on line 334
329.
$slave_key = array_rand($GLOBALS['mysql']['MYSQL_SLAVE']);
330.
$sth = $this->db_instance($GLOBALS['mysql']['MYSQL_SLAVE'][$slave_key], 'slave_'.$slave_key)->prepare($sql);
331.
}
332.
else
333.
{
334.
335.
$sth = $this->db_instance($GLOBALS['mysql'], 'master')->prepare($sql);
}
336.
337.
if(is_array($params) && !empty($params))
338.
{
339.
foreach($params as $k=>&$v) $sth->bindParam($k, $v);
- D:\wwwroot\shangpu\wwwroot\protected\include\core.php on line 322
317.
return empty($this->page) ? '' : " LIMIT {$this->page['offset']},{$this->page['limit']}";
318.
}
319.
return $limit ? ' LIMIT '.$limit : '';
320.
}
321.
322.
323.
public function query($sql, $params = array()){return $this->execute($sql, $params, true);}
324.
public function execute($sql, $params = array(), $readonly = FALSE)
325.
{
326.
$this->sql[] = $sql;
327.
if($readonly && !empty($GLOBALS['mysql']['MYSQL_SLAVE']))
- D:\wwwroot\shangpu\wwwroot\protected\include\core.php on line 200
195.
{
196.
$sort = !empty($sort) ? ' ORDER BY '.$sort : '';
197.
$conditions = $this->_where($conditions);
198.
199.
$sql = ' FROM '.$this->table_name.$conditions["_where"];
200.
201.
$total = $this->query('SELECT COUNT(*) as M_COUNTER '.$sql, $conditions["_bindParams"]);
if($total[0]['M_COUNTER'] > 0)
202.
{
203.
$limit = $this->set_limit($limit, $total[0]['M_COUNTER']);
204.
return $this->query('SELECT '. $fields . $sql . $sort . $limit, $conditions["_bindParams"]);
205.
}
- D:\wwwroot\shangpu\wwwroot\protected\model\region_model.php on line 16
11.
/**
12.
* 获取成都列表
13.
*/
14.
public function indexed_list($val)
15.
{
16.
17.
if($find_all = $this->find_all(array('pid'=>$val), 'sort ASC')) $find_all = array_column($find_all, 'name', 'id');
return $find_all;
18.
}
19.
20.
public function indexed_list2($level=2)
21.
{
- D:\wwwroot\shangpu\wwwroot\protected\include\functions.php on line 285
280.
281.
/*成都区域*/
282.
function cdarea($pid=390)
283.
{
284.
$area = new region_model();
285.
286.
return $area->indexed_list($pid);
}
287.
288.
function cityarea($pid=2)
289.
{
290.
$area = new region_model();
- D:\wwwroot\shangpu\wwwroot\protected\controller\category_controller.php on line 28
23.
$_GET['cate'] = $conditions['cate'];
24.
}
25.
26.
if(!empty($conditions['area']))
27.
{
28.
29.
$this->dist_list = cdarea($conditions['area']);
}
30.
31.
if(!empty($conditions['cate']))
32.
{
33.
$goods_cate_model = new goods_cate_model();
- D:\wwwroot\shangpu\wwwroot\protected\include\core.php on line 87
82.
$action_name = 'action_'.$__action;
83.
if(!class_exists($controller_name, true)) err("Err: Controller '$controller_name' is not exists!");
84.
$controller_obj = new $controller_name();
85.
if(!method_exists($controller_obj, $action_name)) err("Err: Method '$action_name' of '$controller_name' is not exists!");
86.
87.
88.
$controller_obj->$action_name();
89.
function url($c = 'main', $a = 'index', $param = array()) {
90.
if(is_array($c)) {
91.
$param = $c;
92.
if(isset($param['m'])) $m = $param['m']; unset($param['m']);
- D:\wwwroot\shangpu\wwwroot\index.php on line 5
1.
<?php
2.
define('APP_DIR', realpath('./'));
3.
defined('DS') or define('DS', DIRECTORY_SEPARATOR);
4.
define('INCL_DIR', APP_DIR.DS.'protected'.DS.'include');
5.
require(INCL_DIR.DS.'core.php');