i have a problem to display the output of the stored procedure after success run the procedure...i hope everyone can help me....here my stored procedure..
$sql = "EXEC [dbo].[sp_mRetailerRegInfo_Add] '$var1','$var2','$var3','$var4','',''";
This my sample data in my SP
EXEC sp_mRetailerRegInfo_Add 'asdf','asdf','bacc@abc.com','123', @RetailerId output, @ErrorCode output
and this is my sample code ..i can run the procedure but it's not display the output
<?php
$serverName = "localhost";
$connectionInfo = array( "Database"=>"db", "UID"=>"user", "PWD"=>"pass");
$conn = sqlsrv_connect( $serverName, $connectionInfo);
if( $conn ) {
echo "Connection established.<br />";
}else{
echo "Connection could not be established.<br />";
die( print_r( sqlsrv_errors(), true));
}
//-----------------------------------------------
// Perform operations with connection.
//-----------------------------------------------
$sql = "EXEC [dbo].[sp_mRetailerRegInfo_Add] '$var1','$var2','$var3','$var4','',''";
$result = sqlsrv_query($conn, $sql);
if (!$result) {
echo 'Your code is fail.';
}
else {
echo 'Success!';
echo $result;
}
?>
the output will be like this (ID0001) and but i get the output like this
Connection established.
Success!Resource id #3