简体   繁体   中英

Executing Azure SQL stored procedure from php

I have a stored procedure on an Azure SQL database. I'm trying to run the stored procedure from PHP but I'm not sure how to execute it.

Here is my attempt:

$playerQuery="{dbo.player_strength_update '$player'}";
$playerResult=sqlsrv_query($conn, $playerQuery) or die("Could not run stored procedure");

It consistently fails with the die result.

Resolved the problem after a day of banging my head on the wall.

I found that my stored procedure was all sorts of wrong. But my original question was to verify that I was even executing the procedure call properly. Below is the exact PHP syntax I'm using in case it helps anyone else:

$playerQuery="dbo.player_strength_update '$player'";
$playerResult=sqlsrv_query($conn, $playerQuery) or die("Could not run stored procedure");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM