西安铁路职业技术学院专业代码 php下使用以下代码连接并测试
程序员文章站
2022-06-16 13:56:27
...
复制代码 代码如下:
while($row = mssql_fetch_array($result))
{
echo "" . $row["Employee"] . " ";
}
$myServer = "localhost"; //主机
$myUser = "sa"; //用户名
$myPass = "password"; //密码
$myDB = "Northwind";? //MSSQL库名
$s = @mssql_connect($myServer, $myUser, $myPass)
or die("Couldn't connect to SQL Server on $myServer");
$d = @mssql_select_db($myDB, $s)
or die("Couldn't open database $myDB");
$query = "SELECT TitleOfCourtesy+' '+FirstName+' '+LastName AS Employee ";
$query .= "FROM Employees ";
$query .= "WHERE Country='USA' AND Left(HomePhone, 5) = '(206)'";
$result = mssql_query($query);
$numRows = mssql_num_rows($result);
echo "
" . $numRows . " Row" . ($numRows == 1 ? "" : "s") . " Returned
";while($row = mssql_fetch_array($result))
{
echo "
}
以上就介绍了西安铁路职业技术学院专业代码 php下使用以下代码连接并测试,包括了西安铁路职业技术学院专业代码方面的内容,希望对PHP教程有兴趣的朋友有所帮助。