Database Err: SQLSTATE[HY000] [1045] Access denied for user 'db_yewang2018_1'@'172.19.0.4' (using password: YES)
- /home/611c6ea3-8fef-47f0-b322-a8b33b594134/wwwroot/wlb/lib/speed.php on line 329
324.
}
325.
public function dbInstance($db_config, $db_config_key, $force_replace = false){
326.
if($force_replace || empty($GLOBALS['mysql_instances'][$db_config_key])){
327.
try {
328.
$GLOBALS['mysql_instances'][$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'].'\''));
329.
330.
}catch(PDOException $e){err('Database Err: '.$e->getMessage());}
}
331.
return $GLOBALS['mysql_instances'][$db_config_key];
332.
}
333.
private function _where($conditions){
334.
$result = array( "_where" => " ","_bindParams" => array());
- /home/611c6ea3-8fef-47f0-b322-a8b33b594134/wwwroot/wlb/lib/speed.php on line 316
311.
$this->sql[] = $sql;
312.
if($readonly && !empty($GLOBALS['mysql']['MYSQL_SLAVE'])){
313.
$slave_key = array_rand($GLOBALS['mysql']['MYSQL_SLAVE']);
314.
$sth = $this->dbInstance($GLOBALS['mysql']['MYSQL_SLAVE'][$slave_key], 'slave_'.$slave_key)->prepare($sql);
315.
}else{
316.
317.
$sth = $this->dbInstance($GLOBALS['mysql'], 'master')->prepare($sql);
}
318.
if(is_array($params) && !empty($params)){
319.
foreach($params as $k=>&$v) $sth->bindParam($k, $v);
320.
}
321.
if($sth->execute())return $readonly ? $sth->fetchAll(PDO::FETCH_ASSOC) : $sth->rowCount();
- /home/611c6ea3-8fef-47f0-b322-a8b33b594134/wwwroot/wlb/lib/speed.php on line 309
304.
$this->page['all_pages'] = range($total_page-$scope+1, $total_page);
305.
}
306.
}
307.
return $this->page;
308.
}
309.
310.
public function query($sql, $params = array()){return $this->execute($sql, $params, true);}
public function execute($sql, $params = array(), $readonly = false){
311.
$this->sql[] = $sql;
312.
if($readonly && !empty($GLOBALS['mysql']['MYSQL_SLAVE'])){
313.
$slave_key = array_rand($GLOBALS['mysql']['MYSQL_SLAVE']);
314.
$sth = $this->dbInstance($GLOBALS['mysql']['MYSQL_SLAVE'][$slave_key], 'slave_'.$slave_key)->prepare($sql);
- /home/611c6ea3-8fef-47f0-b322-a8b33b594134/wwwroot/wlb/lib/speed.php on line 230
225.
$limit = $this->pager($limit[0], $limit[1], $limit[2], $total[0]['M_COUNTER']);
226.
$limit = empty($limit) ? '' : ' LIMIT '.$limit['offset'].','.$limit['limit'];
227.
}else{
228.
$limit = !empty($limit) ? ' LIMIT '.$limit : '';
229.
}
230.
231.
return $this->query('SELECT '. $fields . $sql . $sort . $limit, $conditions["_bindParams"]);
}
232.
public function find($conditions = array(), $sort = null, $fields = '*'){
233.
$res = $this->findAll($conditions, $sort, $fields, 1);
234.
return !empty($res) ? array_pop($res) : false;
235.
}
- /home/611c6ea3-8fef-47f0-b322-a8b33b594134/wwwroot/wlb/lib/speed.php on line 233
228.
$limit = !empty($limit) ? ' LIMIT '.$limit : '';
229.
}
230.
return $this->query('SELECT '. $fields . $sql . $sort . $limit, $conditions["_bindParams"]);
231.
}
232.
public function find($conditions = array(), $sort = null, $fields = '*'){
233.
234.
$res = $this->findAll($conditions, $sort, $fields, 1);
return !empty($res) ? array_pop($res) : false;
235.
}
236.
public function findfield($conditions = array(), $sort = null, $fields = '*'){
237.
$res = $this->find($conditions, $sort, $fields);
238.
return !empty($res) ? $res[$fields] : false;
- /home/611c6ea3-8fef-47f0-b322-a8b33b594134/wwwroot/wlb/functions/sql.php on line 71
66.
* @param $param条件
67.
* @param $model模型
68.
*/
69.
function get_model_one($param,$model,$title='*',$sort=null){
70.
$obj=M($model);
71.
72.
$row=$obj->find($param,$sort,$title);
if($row){
73.
return $row;
74.
}else{
75.
return false;
76.
}
- /home/611c6ea3-8fef-47f0-b322-a8b33b594134/wwwroot/addons/web/controller/Pccontroller.php on line 23
18.
19.
20.
//$this->url="http://www.testzlcut.cc";
21.
22.
//系统设置参数
23.
24.
$sys=get_model_one(null, 'news_sys');
$this->sys=$sys;
25.
26.
//导航栏
27.
$toplist=get_model_other(array('is_view'=>1,'pid'=>0), 'news_cate','id,title,templetelist,is_link,link','sort asc');
28.
if($toplist){
- /home/611c6ea3-8fef-47f0-b322-a8b33b594134/wwwroot/wlb/controller/BaseinitController.php on line 25
20.
$this->timestamp = $timestamp;
21.
$this->token = md5("wlb".$timestamp);
22.
$this->session_id=session_id();
23.
/* 简介构造方法 */
24.
if(method_exists($this,'_init')){
25.
26.
$this->_init();
}
27.
}
28.
}
- /home/611c6ea3-8fef-47f0-b322-a8b33b594134/wwwroot/wlb/lib/speed.php on line 189
184.
public $_auto_display = true;
185.
private $_v;
186.
private $_data = array();
187.
public function init_weixin (){ /*$this->wxpublic=get_public();*/ }
188.
public function init (){}
189.
190.
public function __construct(){ /*$this->init_weixin();*/ $this->init();}
public function __get($name){return $this->_data[$name];}
191.
public function __set($name, $value){$this->_data[$name] = $value;}
192.
public function display($tpl_name, $return = false){
193.
if(!$this->_v){
194.
$compile_dir = isset($GLOBALS['view']['compile_dir']) ? $GLOBALS['view']['compile_dir'] : APP_DIR.DS.'wlb'.DS.'tmp';
- /home/611c6ea3-8fef-47f0-b322-a8b33b594134/wwwroot/wlb/lib/speed.php on line 103
98.
}
99.
}else{
100.
BaseController::err404($__controller, $__action);
101.
}
102.
}
103.
104.
$controller_obj = new $controller_name();
$controller_obj->$action_name();
105.
if($controller_obj->_auto_display){
106.
$auto_tpl_name = (empty($__module) ? '' : ADDONS.DS.$__module.DS.'view').DS.$__controller.'_'.$__action.'.html';
107.
if(file_exists(APP_DIR.DS. $auto_tpl_name))$controller_obj->display($auto_tpl_name);
108.
}
- /home/611c6ea3-8fef-47f0-b322-a8b33b594134/wwwroot/index.php on line 14
9.
define ( 'SITE_DOMAIN', strip_tags ( $_SERVER ['HTTP_HOST'] ) );
10.
define ( 'SITE_PATH', dirname ( __FILE__ ) );// 网站根路径设置
11.
//die('hello word');
12.
define('SYSNAME', "管理系统");
13.
//定义css常量
14.
15.
require(APP_DIR.'/wlb/lib/speed.php');
16.
17.
18.