<?php
class QueryManager
{
private $con = false;
private $dbname = "wwwww";
private $dbpass = "xxxxx" ;
private $dbuser = "aaaaa" ;
private $dbip = "localhost";
private function __construct()
{
}
public function ConnectToDb()
{
$con = mysql_connect($dbip,$dbuser,$dbpass);
if (!$con)
{
die('Could not connect: ' . mysql_error());
return false;
}
$b_select_db = mysql_select_db($dbname, $con);
if(!$b_select_db)
{
die('Could select db: ' . mysql_error());
return false;
}
return true;
}
public function GetList()
{
$bcon = $this->ConnectToDb();
$result = mysql_query("SELECT * FROM list");
return $result;
}
}
?>
现在我尝试从index.php调用它 像这样:
<?php
require('QueryManager.php');
$queryManager = new QueryManager();
$result = $queryManager->GetList();
?>
即时通讯使用eclipse pdt + xdebug和php 2.6
debuger只在require上显示的问题('QueryManager.php');
它永远不会通过这条线。
这是我的xdebug日志:
TRACE START [2011-11-09 18:44:05]
0.0490 67608 -> {main}() F:\Apache2.2\htdocs\tst_dev\index.php:0
0.0512 78928 -> require(F:\Apache2.2\htdocs\tst__dev\QueryManager.php) F:\Apache2.2\htdocs\tst__dev\index.php:2
2.6811 zu
TRACE END [2011-11-09 18:44:07]
QueryManager.php中有断点 为什么它不进入?
解决!!
private function __construct()
{
}
需要公开!!