Database Err: SQLSTATE[HY000] [2002] No such file or directory

358.      {
359.          if($force_replace || empty($GLOBALS['instance']['mysql'][$db_config_key]))
360.          {
361.              try{
362.                  $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'].'\''));
363.              }catch(PDOException $e){err('Database Err: '.$e->getMessage());}
364.          }
365.          return $GLOBALS['instance']['mysql'][$db_config_key];
366.      }
367.      
368.      private function _where($conditions)
340.              $slave_key array_rand($GLOBALS['mysql']['MYSQL_SLAVE']);
341.              $sth $this->db_instance($GLOBALS['mysql']['MYSQL_SLAVE'][$slave_key], 'slave_'.$slave_key)->prepare($sql);
342.          }
343.          else
344.          {
345.              $sth $this->db_instance($GLOBALS['mysql'], 'master')->prepare($sql);
346.          }
347.          
348.          if(is_array($params) && !empty($params))
349.          {
350.              foreach($params as $k=>&$v$sth->bindParam($k$v);
328.              return empty($this->page) ? '' " LIMIT {$this->page['offset']},{$this->page['limit']}";
329.          }
330.          return $limit ' LIMIT '.$limit '';
331.      }
332.      
333.      public function query($sql$params = array()){return $this->execute($sql$paramstrue);}
334.      
335.      public function execute($sql$params = array(), $readonly FALSE)
336.      {
337.          $this->sql[] = $sql;
338.          if($readonly && !empty($GLOBALS['mysql']['MYSQL_SLAVE']))
220.      public function find($conditions = array(), $sort null$fields '*')
221.      {
222.          $conditions $this->_where($conditions);
223.          $sql ' FROM '.$this->table_name.$conditions["_where"];
224.          $sort = !empty($sort) ? ' ORDER BY '.$sort '';
225.          $res $this->query('SELECT '$fields $sql $sort ' LIMIT 1'$conditions["_bindParams"]);
226.          return !empty($res) ? array_pop($res) : false;
227.      }
228.      
229.      public function update($conditions$row)
230.      {
5.      {
6.          $id = (int)request('id'0);
7.          $where null;
8.          if(!empty($id)) $where = array('cate_id'=>$id);
9.          $product_cate_model = new product_cate_model();        
10.          $this->cate $product_cate_model->find(array('cate_id'=>$id));
11.          
12.          $product_model = new product_model();
13.          if($id!=11){
14.              $product_list $product_model->find_all(array('cate_id'=>$id), 'created_date DESC''id, title, link, created_date,picture,content ', array(request('page'1), 9));
15.          }else{
89.  $action_name 'action_'.$__action;
90.  if(!class_exists($controller_nametrue)) {header('location:/404.html');exit();}
91.  $controller_obj = new $controller_name();
92.  if(!method_exists($controller_obj$action_name)) err("Err: Method '$action_name' of '$controller_name' is not exists!");
93. 
94.  $controller_obj->$action_name();
95. 
96.  function url($c 'main'$a 'index'$param = array())
97.  {
98.      if(is_array($c))
99.      {
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');
无码潮喷中文字幕在线视频,日韩AV无卡无码午夜观看,亚洲全黄无码动漫一级网站,国产精品看高国产精品不卡,囯产乱色国产精品免费视频,