例子:用PHP3调用Microsoft SQL Server的存储过程_PHP教程
程序员文章站
2022-06-04 23:48:58
...
存储过程(procedure.sql):
create procedure hello
@yourname varchar(50) = "无名士"
as
select @yourname + ",你好!"
go
PHP3程序(procedure.php3):
$server = mssql_connect("localhost","sa","") or die("无法连接数据库服务器!");
$db = mssql_select_db("test",$server) or die("无法连接test数据库!");
echo "";
";
mssql_close($server) or die("无法与数据库服务器断开连接!");
?>
create procedure hello
@yourname varchar(50) = "无名士"
as
select @yourname + ",你好!"
go
PHP3程序(procedure.php3):
$server = mssql_connect("localhost","sa","") or die("无法连接数据库服务器!");
$db = mssql_select_db("test",$server) or die("无法连接test数据库!");
echo "
" . $fields[$i] . " | ";|
---|---|
"; | " . $value . " | ";
mssql_close($server) or die("无法与数据库服务器断开连接!");
?>
上一篇: SQL Server 身份验证标准连接: