I\'ve looked over several other questions that seem (from the titles) the same as this. However, my case is a bit different.
The following works (i.e. I get \"succes
This is a follow up to the answer by @chris85.
It's worth noting here that once the statement is prepared, you need to execute it:
$sql = "EXEC stp_Create_Item @Item_ID = ?, @Item_Name = ?";
$stmt = sqlsrv_prepare($conn, $sql, $procedure_params);
if (!sqlsrv_execute($stmt)) {
echo "Your code is fail!";
die;
}
while($row = sqlsrv_fetch_array($stmt)){
//Stuff
}
sqlsrv_execute() only returns true/false. If you want to parse the data returned by the stored procedure you can process it just like the result from sqlsrv_query().
If you forget the sqlsrv_execute() you'll get an error saying that the result has to be executed before it can be used.