1 php代码
<?
$server_name="127.0.0.1";
$db_name="intranet_db";
$db_user="root";
$db_pwd="root";
try
{
$dbh=new PDO('mysql:host='.$server_name.';dbname='.$db_name,$db_user,$db_pwd);
$dbh->query('SET NAMES gbk');
$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
}
catch (PDOException $e)
{
print("Error:".$e->getMessage());
die();
}
$sta_array=array("Finished","In process","Pause","Stop","Waiting","Advice","Need help");
?>
2 数据库是本地,通脱navicat可以连接
3 php.ini 已经开启 extension=php_pdo_mysql.dll
extension=php_pdo.dll
extension=php_pdo_mysql.dll
extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
extension=php_pdo_mssql.dll
extension=php_pdo_odbc.dll
extension=php_pdo_firebird.dll
php.ini文件里的这些都去掉前面的;,重启apache试试
因为是下载的代码,应该没问题,是短标签的问题。