Php extension sqlsrv call mssql stored procedure
<无详细内容>
- $ ServerName = "127.0.0.1 ";
- $ ConnectionInfo = array ("UID" => "sa", "PWD" => "", "Database" => "test ");
- $ Conn = sqlsrv_connect ($ serverName, $ connectionInfo );
- If ($ conn = false)
- {
- Echo "cocould not connect. \ n ";
- Die (print_r (sqlsrv_errors (), true ));
- }
- $ Spnumber = '1970 ***** 00 ';
- $ Chargenumber = '1970 ***** 155 ';
- // 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.
- $ 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 ));
- }
|