/* prepare the statement resource */ $stmt=mssql_init("your_stored_procedure", $conn); /* now bind the parameters to it */ mssql_bind($stmt, "@id", $id, SQLINT4, FALSE); mssql_bind($stmt, "@name", $name, SQLVARCHAR, FALSE); mssql_bind($stmt, "@email", $email, SQLVARCHAR, FALSE); /* now execute the procedure */ $result = mssql_execute($stmt);
Another Example
$conn = mssql_connect($db_host,$db_user,$db_password);if ($conn===false){ echo 'Cannot connect.'; exit; } if (mssql_select_db("YourDatabase",$conn) === false) { echo 'no database'; exit; } $proc = mssql_init('YourStoredProcedure',$conn); mssql_bind($proc,'@ParameterOne',$ParameterOne,SQLVARCHAR); mssql_bind($proc,'@ParameterTwo',$ParameterTwo,SQLVARCHAR); mssql_bind($proc,'@ParameterThree',$ParameterThree,SQLVARCHAR); if ($result = mssql_execute($proc)) { if ($row = mssql_fetch_row($result)){ // process results } }
Sayed Ahmed
Linkedin: https://ca.linkedin.com/in/sayedjustetc
Blog: http://bangla.saLearningSchool.com http://SitesTree.com,
Online and Offline Training: http://training.SitesTree.com