<?php /* Stored Procedure Test/* error_reporting (0); /* Stored procedure: Database connection ------------------------------------------------------*/ Define (' Msdb_host ', ' 1.2.3.4 '); Define (' Msdb_port ', 1433); Define (' Msdb_user ', ' Yang '); Define (' Msdb_pass ', ' Yangjunwei '); Define (' Msdb_name ', ' Gameuserdb '); $conn = Mssql_connect (Msdb_host,msdb_user,msdb_pass) or Die ("SQL SERVER database connection failed!") "); mssql_select_db (Msdb_name); /* Stored procedures: Modify the specified user password ------------------------------------------------------*/ $action _type = ' lostpass '; Type of action $User _id = 1; User ID $User _name = ' Yang '; User name $User _pass = MD5 ("123456"); Original User Password $User _PASS2 = MD5 ("654321"); New User Password $User _null = null; $stmt = Mssql_init ("Updateuserinfo", $conn) or Die ("Initialize stored procedure failure");//Initialize a stored procedure Mssql_bind ($stmt, "@Typ", $action _type, Sqlvarchar); Mssql_bind ($stmt, "@UserID", $User _id, SQLINT4); Mssql_bind ($stmt, "@LogonPass", $User _pass, SQLCHAR); Mssql_bind ($stmt, "@LogonPass2", $User _pass2, SQLCHAR); Mssql_bind ($stmt, "@dwUserID", $User _null, SQLINT4, False, false); Mssql_bind ($stmt, "@strCompellation", $User _null, Sqlvarchar); Mssql_bind ($stmt, "@strQQ", $User _null, Sqlvarchar); Mssql_bind ($stmt, "@strEmail", $User _null, Sqlvarchar); Mssql_bind ($stmt, "@strSeatPhone", $User _null, Sqlvarchar); Mssql_bind ($stmt, "@strMobilePhone", $User _null, Sqlvarchar); Mssql_bind ($stmt, "@strDwellingPlace", $User _null, Sqlvarchar); Mssql_bind ($stmt, "@strPostalCode", $User _null, Sqlvarchar); Mssql_bind ($stmt, "@strUserNote", $User _null, Sqlvarchar); Mssql_bind ($stmt, "@FaceID", $User _null, SQLINT4); /* Mssql_bind ($stmt, "RETVAL", $val, Sqlvarchar); Used to return the value of return-103 this class directly. $result = Mssql_execute ($stmt, true); Cannot return result set, can only get output parameter echo $val. ' <br/> '; echo "This User ID is:". $UserID. ' <br/> '; echo "This user name is:". $Accounts. ' <br/> '; */ $result = Mssql_execute ($stmt, false); return result set $records =mssql_fetch_array ($result); Print_r ($records); Mssql_next_result ($result); Next result set, when equal to false, the next one is the output parameter MSSQL debugging Die (' MSSQL error: '. Mssql_get_last_message ()); Exit ?> |