开发者

Call SQL Server 2008 Stored Procedure from PHP passing in Parameters

I need to call a sql server stored procedure from PHP passing in some parameters. I have the following:

$serverName = "DB";
$connectionInfo = array( "UID"=>"***", "PWD"=>"***", "Database"=>"database");
$conn = sqlsrv_connect( $serverName, $connectionInfo);
$tsl = "EXEC GetAccountUser(?, ?)";

However when I pass in an array of params, i开发者_如何学Pythont does not work.

Can someone please help? Example code would be appreciated.


$addProduct = $obj->ExecuteQuery("Begin;DECLARE @ProductCode as varchar (100) ;EXEC CREATEPRODUCT'$pname', '$price', @ProductCode OUTPUT, '$merchantId';select @ProductCode;End;");

$productCode = $addProduct[0][0];

For more explanation, you can visit this site.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜