How to get the return value of stored procedure of sql server by PDO?

May 2, 2012 at 6:30 AM

I want to show the return value of sp of sql server 2008 on web page by pdo, but i don`t know how to 

do it!   although i tried to use this way, but i wasn`t succeeded :(((

 $sql ="{:returnValue = call [dbo].[DTBL_PreRegister_Insert](:regCode, :opType,...)}";

$preRegResult = $conn->prepare($sql); 

 $returnValue = null;       

$preRegResult->bindParam('returnValue', $returnValue, PDO::PARAM_STR|PDO::PARAM_INPUT_OUTPUT ,15); 

$preRegResult->bindParam('regCode', $preRegisterationCode, PDO::PARAM_STR ); 

  $preRegResult->bindParam('opType', $PreRegisterType, PDO::PARAM_STR );


     if ($returnValue == '0')   {  

        echo 'unsuccessful;  

       }     else     {      

        echo 'successful';   }

May 3, 2012 at 6:19 PM

Can you please post in the forums? I'm the only one that checks these issues and will be away on vacation:



May 3, 2012 at 7:51 PM

yea , surely, I`m sorry for that...

Thank you for your notification ,Jonathan ;-)