数据库链接错误 : Connection refused

87.       * @param dbConfig  数据库配置
88.       */
89.      public function __construct($dbConfig)
90.      {
91.          $linkfunction = ( TRUE == $dbConfig['persistent'] ) ? 'mysql_pconnect' 'mysql_connect';
92.          $this->conn $linkfunction($dbConfig['host'].":".$dbConfig['port'], $dbConfig['login'], $dbConfig['password']) or spError("数据库链接错误 : " mysql_error()); 
93.          mysql_select_db($dbConfig['database'], $this->conn) or spError("无法找到数据库,请确认数据库名称正确!");
94.          $this->exec("SET NAMES UTF8");
95.      }
96.      /**
97.       对特殊字符进行过滤
144.          }
145.      }
146.      if(FALSE != $has_define){
147.          $argString '';$comma ''
148.          if(null != $args)for ($i 0$i count($args); $i ++) { $argString .= $comma "\$args[$i]"$comma ', '; } 
149.          eval("\$GLOBALS['G_SP']['inst_class'][\$class_name]= new \$class_name($argString);"); 
150.          return $GLOBALS['G_SP']["inst_class"][$class_name];
151.      }
152.      spError($class_name."类定义不存在,请检查。");
153.  }
154. 
47.      {
48.          if( null == $this->tbl_name )$this->tbl_name $GLOBALS['G_SP']['db']['prefix'] . $this->table;
49.          if( '' == $GLOBALS['G_SP']['db_driver_path'] ){
50.              $GLOBALS['G_SP']['db_driver_path'] = $GLOBALS['G_SP']['sp_drivers_path'].'/'.$GLOBALS['G_SP']['db']['driver'].'.php';
51.          }
52.          $this->_db spClass('db_'.$GLOBALS['G_SP']['db']['driver'], array(0=>$GLOBALS['G_SP']['db']), $GLOBALS['G_SP']['db_driver_path']);
53.      }
54. 
55.      /**
56.       从数据表中查找一条记录
57.       *
144.          }
145.      }
146.      if(FALSE != $has_define){
147.          $argString '';$comma ''
148.          if(null != $args)for ($i 0$i count($args); $i ++) { $argString .= $comma "\$args[$i]"$comma ', '; } 
149.          eval("\$GLOBALS['G_SP']['inst_class'][\$class_name]= new \$class_name($argString);"); 
150.          return $GLOBALS['G_SP']["inst_class"][$class_name];
151.      }
152.      spError($class_name."类定义不存在,请检查。");
153.  }
154. 
1015.          return $result_str;    //返回结果
1016.      }
1017. 
1018.      //判断是否有通知函数 王帅
1019.      function is_notice(){
1020.              $notice spClass('notice');
1021.              $is_notice $notice->find(array('cat_id'=>$_SESSION['ID'],'state'=>'0'));
1022.              if($is_notice){
1023.                  $this->is_notice $is_notice;
1024.          }
1025.      }
161.              header("Location: https://www.juaicheng.com/");
162.                          exit();
163.            }
164.                  }
165.          //调用函数 检测是否有通知
166.          $this->is_notice();
167.          //获取城市信息
168.          $this->get_city();
169.          if($this->city_res["name"] == "廊坊"){
170.              $this->city_res["name"] = "秦皇岛";
171.              $this->city_res["cat_id"] = 1803;
358.          $this->display("tpl/user_front/login.html");
359.          $this->footer();
360.      }
361.      //找回密码
362.      function f_password(){
363.          $this->header();
364.          $data=$this->spArgs();
365.          $user=spClass('b_user');
366.          $user->verifier $user->verifier_password// 切换验证规则
367.          $ver $user->spVerifier($this->spArgs());
368.          if($data['submit']){
16.      if(!is_object($handle_controller) || !method_exists($handle_controller$__action)){
17.          eval($GLOBALS['G_SP']["dispatcher_error"]);
18.          exit;
19.      }
20.      // 路由并执行用户代码
21.      $handle_controller->$__action();
22.      // 控制器程序运行完毕,进行模板的自动输出
23.      if(FALSE != $GLOBALS['G_SP']['view']['auto_display']){
24.          $__tplname $__controller.$GLOBALS['G_SP']['view']['auto_display_sep'].
25.                  $__action.$GLOBALS['G_SP']['view']['auto_display_suffix']; // 拼装模板路径
26.          $handle_controller->auto_display($__tplname);
42.  import(APP_PATH.'/include/thFunctions.php'); //smarty自写函数 
43. 
44.  import(APP_PATH.'/controller/top.php'); //TOP全局控制器 
45. 
46.  header("Content-type: text/html; charset=utf-8"); 
47.  spRun();
48.