$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 . $row[employee] . ;
}
http://www.bkjia.com/phpjc/318889.htmlwww.bkjia.comtruehttp://www.bkjia.com/phpjc/318889.htmltecharticle复制代码 代码如下: ?php $myserver=localhost;//主机 $myuser=sa;//用户名 $mypass=password;//密码 $mydb=northwind;?//mssql库名 $s=@mssql_connect($myserver,$my...
