- $serverName = "127.0.0.1";
- $connectionInfo = array( "UID"=>"sa","PWD"=>"","Database"=>"test");
- $conn = sqlsrv_connect( $serverName, $connectionInfo);
- if( $conn === false )
- {
- echo "Could not connect.n";
- die( print_r( sqlsrv_errors(), true));
- }
- $spnumber = '10655****00';
- $chargenumber = '155****6789';
-
- //Parameters need to be assigned in the following array format and marked with types. SQLSRV_PARAM_IN is the input type, and SQLSRV_PARAM_OUT is the output type. Note that values must be assigned in the order defined by the stored procedure
- $params = array(
- array(&$spnumber, SQLSRV_PARAM_IN),
- array(&$chargenumber, SQLSRV_PARAM_IN)
- );
- $tsql_callSP = "{call msgexpress_UnicomNewSubmit(?,?) }";
- $stmt3 = sqlsrv_query( $conn, $tsql_callSP, $params);
- if( $stmt3 === false )
- {
- echo "Error in executing statement 3.n";
- die( print_r( sqlsrv_errors( ), true));
- }
Copy code
|