PHP Get return value from MSSQL Stored Procedure

后端 未结 1 1239
深忆病人
深忆病人 2021-01-27 11:47

I can\'t get the OUTPUT parameter from my SQL Server (MSSQL 2012) SP to return to PHP. My Stored procedure is:

CREATE PROCEDURE spGetNextSeqID @ID AS INT OUTPUT         


        
相关标签:
1条回答
  • 2021-01-27 12:45

    New:

    I missed that you are using a single parameter as both input and output. Please try the following.

    array($outSeq, SQLSRV_PARAM_INOUT)
    

    Then using

    sqlsrv_next_result($stmt);
    echo $outSeq;
    

    Reference: http://technet.microsoft.com/en-us/library/cc644932(v=sql.105).aspx

    Old:

    You must set up $outSeq with the appropriate data type. Try initialize the value to $outSeq = 0.00, since your output type is MONEY.

    Please reference the following article:

    http://technet.microsoft.com/en-us/library/cc626303(v=sql.105).aspx

    0 讨论(0)
提交回复
热议问题