PHP
$ hostname = "tszz";
$ dbuser = "sa";
$ dbpasswd = "";
$ ID = MSSQL_CONNECT ($ HostName, $ DBUSER, $ dbpasswd) or Die ("Unable to connect Database Server!"); // Printf ("% D
/ N", $ ID); $ db = mssql_select_db (" Stock ", $ ID) OR DIE (" Unable to connect to the stock database! "); $ stockcode = '600600'; $ ID = 0; $ msg = 0; // printf ("% d
/ n ", $ DB); // $ query = "exec sp_test @ code = '600028', @ id = 0, @ msg = '000000'"; $ query = "declare @Result int, @ID int, @msg varchar (20) /N"; $ Query.="exec @ result = sp_test / n "; $ query. =" / "$ stockcode /", / n "; $ query. =" @ id output, / n "; $ query. = "@ msg output; / n"; $ query. = "SELECT @Result result, @ID ID, @MSG msg"; / * $ query = "declare @Result int, @id, @msg varchar (20) /N"; $ Query.="exec @ result = sp_test / n "; $ query. =" / "$ stockcode /", / n "; $ query. =" @ id output, / n "; $ query. = "@ msg output; / n"; $ query. = "SELECT @Result result, @ID id, @msg msg"; * /// $ query = "Update test set stockname = '2test' where stockcode = '600028 '"; // $ query =" INTO TEST (stockcode, stockname, id) VALUES (' 600028 ',' Test ', 13) "; // $ query =" SELECT * from test where stockcode =' 600028 '" ; // $ query = "SELECT 0 where 1 = 0"; $ rresult = mssql_query ($ query) O R Die ("SQL: $ query"); $ arr = mssql_fetch_Array ($ RRESULT); Print $ Result; Print "
/ n"; Printf ("% D,% D,% S
) / N ", $ arr [result], $ arr [id], $ arr [msg]); Printf ("% D,% s
/ n ", $ ID, $ msg);
// $ stock = mssql_fetch_array ($ result); // $ name = $ stock [id]; //print $ name; // print "abc";?>>