/* 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 } }
From: http://sitestree.com/php-sql-server-stored-procedure-prepare-the-statement-resource-stmtmssql_inityour_stored_procedure-conn-now-bind-the-parameters-to-it-mssql_bindstmt-id-id-sqlint4-fa/
Categories:Root
Tags:
Post Data:2019-09-21 08:44:53
Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada