PHP extension sqlsrv call MSSQL stored procedure

Source: Internet
Author: User
<无详细内容>
    1. $serverName = "127.0.0.1";
    2. $connectionInfo = Array ("UID" = "sa", "PWD" and "" "," Database "=" test ");
    3. $conn = Sqlsrv_connect ($serverName, $connectionInfo);
    4. if ($conn = = = False)
    5. {
    6. echo "Could not connect.\n";
    7. die (Print_r (Sqlsrv_errors (), true));
    8. }
    9. $spnumber = ' 10655****00 ';
    10. $chargenumber = ' 155****6789 ';
    11. The
    12. //parameter needs to be assigned a value as an array of type, sqlsrv_param_in is the input type, and sqlsrv_param_out is the output type. Note To assign a value in the order defined by the stored procedure
    13. $params = Array (
    14. Array (& $spnumber, sqlsrv_param_in),
    15. Array (& $cha Rgenumber, sqlsrv_param_in)
    16. );
    17. $tsql _callsp = "{call Msgexpress_unicomnewsubmit (?,?)}";
    18. $stmt 3 = sqlsrv_query ($conn, $tsql _callsp, $params);
    19. if ($stmt 3 = = = False)
    20. {
    21. echo "Error in executing statement 3.\n";
    22. die (Print_r (Sqlsrv_errors (), true));
    23. }
Copy Code
  • 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.