作者:多米音乐_34216717 | 来源:互联网 | 2017-05-12 14:55
PHP如何与 MSSQL连接
PHP如何与 MSSQL连接
在PHP wadhwahitesh的Windows,MS SQL Server的,PHP脚本语言,PHP和
标签:PHP中,MSSQL,WAMP的
我已经成功连接的mssql使用PHP,但是我得到下列警告和系统死亡。请让我知道这个问题尽快解决。谢谢
Warning: mssql_query(): supplied argument is not a valid MS SQL-Link resource in C:wampwwwtestsql2005index. on line 11
Warning: mssql_fetch_array(): supplied argument is not a valid MS SQL-result resource in C:wampwwwtestsql2005index.php on line 12
Line 11 : $qry = mssql_query($sql1,$dblink);
Line 12 : while ($row = mssql_fetch_array($qry)){
$server = 'DIVINE-2953FF11,';
$server = 'DIVINE-2953FF11SQLEXPRESS';
$db='';
$dbuser = '';
$dbpass = '';
$link = mssql_connect($server, $dbuser, $dbpass) or die("cannot connect to server");
$dblink = mssql_select_db($db, $link) or die("cannot connect to database");
$sql1 = "SELECT firstname FROM dbo.persons";
$qry = mssql_query($sql1,$dblink);
while ($row = mssql_fetch_array($qry)){
echo $row["FirstName"];
}
mssql_close($link);