note 110950 deleted from function.sqlsrv-prepare by aharvey
| From: | aharvey@php.net | Date: | Tue, 08 Jan 2013 02:36:42 +0000 |
| Subject: | note 110950 deleted from function.sqlsrv-prepare by aharvey | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-192797@lists.php.net to get a copy of this message | ||
Note Submitter: Anonymous
----
Its words :
Stored Procedure with input param on PHP Version => 5.4.6; (For windows Xp -> Download
Unofficial Microsoft SQL Server Driver for PHP (sqlsrv) http://robsphp.blogspot.co.uk/2012/06/unofficial-microsoft-sql-server-driver.html)
and download Microsoft Visual C++ 2010 x86 Redistributable Setup
$sql = new PDO( "sqlsrv:server=$server;Database = $database", $user, $password);
$query = "{? = CALL sp_Login(?, ?)}";
$stmt = $sql->prepare( $query );
$returnVariable = 0;
$inputVariable1 = 'input1';
$inputVariable2 = 'input2';
$stmt->bindParam(1,$returnVariable,PDO::PARAM_INT|PDO::PARAM_INPUT_OUTPUT,100);
$stmt->bindParam(2,$inputVariable1,PDO::PARAM_STR);
$stmt->bindParam(3,$inputVariable2,PDO::PARAM_STR);
$stmt->execute();
echo "Return value: ".$returnVariable;