Php extension sqlsrv call mssql stored procedure

Source: Internet
Author: User
Php extension sqlsrv call mssql stored procedure
<无详细内容>

  1. $ ServerName = "127.0.0.1 ";
  2. $ ConnectionInfo = array ("UID" => "sa", "PWD" => "", "Database" => "test ");
  3. $ Conn = sqlsrv_connect ($ serverName, $ connectionInfo );
  4. If ($ conn = false)
  5. {
  6. Echo "cocould not connect. \ n ";
  7. Die (print_r (sqlsrv_errors (), true ));
  8. }
  9. $ Spnumber = '1970 ***** 00 ';
  10. $ Chargenumber = '1970 ***** 155 ';
  11. // You need to assign values and indicate the type in the following array. SQLSRV_PARAM_IN indicates the Input type and SQLSRV_PARAM_OUT indicates the output type. Note that values should be assigned according to the sequence defined in the stored procedure.
  12. $ Params = array (
  13. Array (& $ spnumber, SQLSRV_PARAM_IN ),
  14. Array (& $ chargenumber, SQLSRV_PARAM_IN)
  15. );
  16. $ Tsql_callSP = "{call msgexpress_UnicomNewSubmit (?,?)} ";
  17. $ Stmt3 = sqlsrv_query ($ conn, $ tsql_callSP, $ params );
  18. If ($ stmt3 = false)
  19. {
  20. Echo "Error in executing statement 3. \ n ";
  21. Die (print_r (sqlsrv_errors (), true ));
  22. }

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.