I am using the sqlsrv ms drivers for php, which work fine (tested with normal queries), I have also tested it with running a stored procedure to update table data which also works, know i want to use it to run a stored procedure and i want the response, how can this be done?
$server = "...the server address...";
$options = array("UID"=>"...the username...","PWD"=>"...the password...",
"Database" => "...the database..."
);
$conn = sqlsrv_connect($server, $options);
if ($conn === false) {die("<pre>".print_r(sqlsrv_errors(), true));}
$tsql_callSP = "{call ...the stored proc...( ?, ?)}";
$params = array(
array("...first value in...", SQLSRV_PARAM_IN),
array("...second value in...", SQLSRV_PARAM_IN)
);
$stmt3 = sqlsrv_query( $conn, $tsql_callSP, $params);
if( $stmt3 === false )
{
echo "Error in executing statement 3.
";
die( print_r( sqlsrv_errors(), true));
}
print_r( $stmt3); //attempting to print the return but all i get is Resource id #3
echo "test echo";
sqlsrv_free_stmt( $stmt3);
sqlsrv_close( $conn);
I know i can use output parameter, but I will always receive multiple values from the stored proc.