时间:2021-07-01 10:21:17 帮助过:28人阅读
附两种连接方式的代码:
//mssql_connect连接方式
//Server and login Info
$SERVER = 'IP';
$USER_NAME = "USER";
$USER_PASS = "PASS";
$DATABASE = "DBNAME";
//Connecting to the server
$CONN = mssql_connect($SERVER, $USER_NAME, $USER_PASS)or die ("Can't connect to Microsoft SQL Server");
//Selecting the database
$connection = mssql_select_db($DATABASE, $CONN)or die ("Can't connect to Database");
if($connection) printf ("Connected successfully");
?>
//ODBC连接方式
$connection_string = 'DRIVER={SQL Server};SERVER=IP;DATABASE=DBNAME';
$user = 'USER';
$pass = 'PASS';
$connection = odbc_connect( $connection_string, $user, $pass ) OR die("??");
if($connection) printf ("Connected successfully");
?>
作者“成长足迹”
http://www.bkjia.com/PHPjc/478658.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/478658.htmlTechArticle环境 PHP5.2.6 SQL2005 标准版 SERVER2003 SP2 1:SQL2005 文件损坏,无法正常使用 然后,未完全卸载干净 结果:重装系统,方便快捷。 2:PHP配置支...