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 214
209.
public function find($conditions = array(), $sort = null, $fields = '*')
210.
{
211.
$conditions = $this->_where($conditions);
212.
$sql = ' FROM '.$this->table_name.$conditions["_where"];
213.
$sort = !empty($sort) ? ' ORDER BY '.$sort : '';
214.
215.
$res = $this->query('SELECT '. $fields . $sql . $sort . ' LIMIT 1', $conditions["_bindParams"]);
return !empty($res) ? array_pop($res) : false;
216.
}
217.
218.
public function update($conditions, $row)
219.
{
- D:\wwwroot\shangpu\wwwroot\protected\model\seller_model.php on line 35
30.
public function getRegion($id = 0)
31.
{
32.
if(!$id)
33.
$res = $this->find(array('visible' => 1),'seq ASC,seller_id ASC','region_id');
34.
else
35.
36.
$res = $this->find(array('seller_id'=>$id));
return $res['region_id'];
37.
}
38.
39.
public function getName($id = 0)
40.
{
- D:\wwwroot\shangpu\wwwroot\protected\controller\room_controller.php on line 22
17.
);
18.
19.
$this->cate_list = $vcache->goods_cate_model('goods_cate_bar');
20.
21.
$seller_model = new seller_model();
22.
23.
$this->area_list = cdarea($seller_model->getRegion(request('SELLER_COOKIE_ID',1,'cookie')));
24.
$this->measure = measure();
25.
26.
$this->minmxprice = minmxprice();
27.
- 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');