Stored procedure (procedure. SQL): createprocedurehello @ yournamevarchar (50) quot; stored procedure (procedure. SQL ):
Create procedure hello
@ Yourname varchar (50) = "no name"
As
Select @ yourname + ", Hello! "
Go
PHP3 program (procedure. php3 ):
"; Echo""; $ Query =" exec hello @ yourname = \ "friend \" "; $ rst = mssql_query ($ query, $ db) or die (" unable to execute SQL: $ query "); $ fields_num = mssql_num_fields ($ rst); $ I = 0; while ($ I <$ fields_num) {$ fields [$ I] = mssql_field_name ($ rst, $ I); echo"". $ Fields [$ I].""; $ I ++;} echo""; While ($ record = mssql_fetch_array ($ rst) {echo""; $ I = 0; while ($ I <$ fields_num) {$ value = $ record [$ fields] [$ I]; if ($ value = "") echo" "; Else echo"". $ Value .""; $ I ++;} echo"";} Mssql_free_result ($ rst); echo""; Mssql_close ($ server) or die (" cannot be disconnected from the database server! ");?>
Permanent address:
Reprint at will ~ Please bring the tutorial URL ^