How does php-PHP use the sqlsrv function to call the stored procedure in MSSQL and return the dataset?

Source: Internet
Author: User
I wrote a stored procedure in MSSQL2008R2, defined a temporary table in the process body, stored the data generated through the business logic into the temporary table, and finally passed the query statement (Select * Fromxxxx) return the data in the temporary table. The problem is: in the SQL query analyzer, the stored procedure with parameters is executed separately, and the result set has data. However, the data cannot be displayed on the PHP front-end. why? The method for executing the stored procedure is as follows: $ paramsarray (array ($ sDate, SQLSRV_PARAM_IN), array ($ eDate, SQLSRV_PA... phpms SQL

I wrote a stored procedure in MS SQL2008R2. a temporary table is defined in the process body and generated through the business logic.
And then return the data in the temporary table through the query statement (Select * From xxxx.
The problem is: in the SQL query analyzer, the stored procedure with parameters is executed separately, and the result set has data.
However, the data cannot be displayed on the PHP front-end. why? The method for executing a stored procedure is as follows:
$ Params = array (
Array ($ sDate, SQLSRV_PARAM_IN ),
Array ($ eDate, SQLSRV_PARAM_IN ),
Array ($ empID, SQLSRV_PARAM_IN ),
Array ($ empName, SQLSRV_PARAM_IN)
);
// Echo"

";print_r($params);echo "
";
// Echo "Exec HR_MonthlyReport '$ sdate',' $ edate', '$ empID', '$ empname '";
$tsql_callSP = "{call HR_MonthlyReport ?,?,?,?}";               $Result = sqlsrv_query( $lik, $tsql_callSP, $params);

If ($ Result = false ){
Echo "Error in executing statement 3. \ n ";

Die (print_r (sqlsrv_errors (), true ));
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.