Copy CodeThe code is as follows:
$myServer = "localhost"; Host
$myUser = "sa"; User name
$myPass = "password"; Password
$myDB = "Northwind";? MSSQL Library Name
$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 "
" . $row ["Employee"]. "";
}
http://www.bkjia.com/PHPjc/318889.html www.bkjia.com true http://www.bkjia.com/PHPjc/318889.html techarticle Copy the code as follows: Php $myServer = "localhost";//host $myUser = "sa";//username $myPass = "password";//password $myDB = "Northwind";? MSSQL Library Name $s = @mssql_connect ($myServer, $my ...