数据库链接错误 : Can't connect to MySQL server on 'localhost' (10061)
- D:\freehost\taomowang\web\SpeedPHP\Drivers\mysql.php on line 92
87.
* @param dbConfig 数据库配置
88.
*/
89.
public function __construct($dbConfig)
90.
{
91.
$linkfunction = ( TRUE == $dbConfig['persistent'] ) ? 'mysql_pconnect' : 'mysql_connect';
92.
93.
$this->conn = $linkfunction($dbConfig['host'].":".$dbConfig['port'], $dbConfig['login'], $dbConfig['password']) or spError("数据库链接错误 : " . mysql_error());
mysql_select_db($dbConfig['database'], $this->conn) or spError("无法找到数据库,请确认数据库名称正确!");
94.
$this->exec("SET NAMES UTF8");
95.
}
96.
/**
97.
* 对特殊字符进行过滤
- D:\freehost\taomowang\web\SpeedPHP\spFunctions.php on line 149
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.
150.
eval("\$GLOBALS['G_SP']['inst_class'][\$class_name]= new \$class_name($argString);");
return $GLOBALS['G_SP']["inst_class"][$class_name];
151.
}
152.
spError($class_name."类定义不存在,请检查。");
153.
}
154.
- D:\freehost\taomowang\web\SpeedPHP\Core\spModel.php on line 52
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.
53.
$this->_db = spClass('db_'.$GLOBALS['G_SP']['db']['driver'], array(0=>$GLOBALS['G_SP']['db']), $GLOBALS['G_SP']['db_driver_path']);
}
54.
public function getAll($sql)
55.
{
56.
$res = $this->query($sql);
57.
if ($res !== false)
- D:\freehost\taomowang\web\SpeedPHP\spFunctions.php on line 149
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.
150.
eval("\$GLOBALS['G_SP']['inst_class'][\$class_name]= new \$class_name($argString);");
return $GLOBALS['G_SP']["inst_class"][$class_name];
151.
}
152.
spError($class_name."类定义不存在,请检查。");
153.
}
154.
- D:\freehost\taomowang\web\modules\index\common.php on line 21
16.
$_REQUEST[$k]=str_replace(array('\'','"','\\'),array(''','"',''),$_REQUEST[$k]);
17.
$_REQUEST[$k]=addslashes($_REQUEST[$k]);
18.
}
19.
}
20.
21.
22.
$row=spClass('site_config')->findAll('id>=100');//基本设置参数
foreach($row as $k=>$v){
23.
$config[$v['id']]=$v['value'];
24.
}
25.
$this->config=$config;
26.
- D:\freehost\taomowang\web\modules\index\main.php on line 6
1.
<?php
2.
class main extends spController
3.
{//显示主页,查询联系我们子栏目
4.
function __construct(){ // 公用
5.
parent::__construct(); // 这是必须的
6.
7.
include('common.php');
8.
$attr=spclass('article_cat')->findAll("pid=8");
9.
foreach($attr as $v)
10.
{
11.
if($v['type_id']==2||$v['type_id']==3)
- D:\freehost\taomowang\web\SpeedPHP\spFunctions.php on line 149
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.
150.
eval("\$GLOBALS['G_SP']['inst_class'][\$class_name]= new \$class_name($argString);");
return $GLOBALS['G_SP']["inst_class"][$class_name];
151.
}
152.
spError($class_name."类定义不存在,请检查。");
153.
}
154.
- D:\freehost\taomowang\web\SpeedPHP\spFunctions.php on line 14
9.
function spRun(){
10.
GLOBAL $__controller, $__action;
11.
// 对路由进行自动执行相关操作
12.
spLaunch("router_prefilter");
13.
// 对将要访问的控制器类进行实例化
14.
15.
$handle_controller = spClass($__controller, null, $GLOBALS['G_SP']["controller_path"].'/'.$__controller.".php");
// 调用控制器出错将调用路由错误处理函数
16.
if(!is_object($handle_controller) || !method_exists($handle_controller, $__action)){
17.
eval($GLOBALS['G_SP']["dispatcher_error"]);
18.
exit;
19.
}
- D:\freehost\taomowang\web\index.php on line 14
9.
// 载入SpeedPHP框架
10.
require(SP_PATH."/SpeedPHP.php");
11.
require("functions_index.php");
12.
require_once('360_safe3.php');
13.
14.
spRun(); // SpeedPHP 3新特性