note 101323 modified in ref.pdo-dblib by danbrown

From: Date: Fri, 10 Dec 2010 00:06:44 +0000
Subject: note 101323 modified in ref.pdo-dblib by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-174760@lists.php.net to get a copy of this message
Here's how to call a stored procedure from MS SQL Server: <?php $return = null; $param1 = 'value1'; $param2 = 'value2'; $ds = $db->prepare('{? = call ?,?}'); $ds->bindParam(1, $return, PDO::PARAM_INT | PDO::PARAM_INPUT_OUTPUT,4); $ds->bindParam(2, $param1, PDO::PARAM_INT | PDO::PARAM_INPUT_OUTPUT,4); $ds->bindParam(3, $param2, PDO::PARAM_INT | PDO::PARAM_INPUT_OUTPUT,4); $ds->execute(); ?> --was-- Here's how to call a stored procedure from MS SQL Server: $return = null; $param1 = 'value1'; $param2 = 'value2'; $ds = $db->prepare('{? = call ?,?}'); $ds->bindParam(1, $return, PDO::PARAM_INT | PDO::PARAM_INPUT_OUTPUT,4); $ds->bindParam(2, $param1, PDO::PARAM_INT | PDO::PARAM_INPUT_OUTPUT,4); $ds->bindParam(3, $param2, PDO::PARAM_INT | PDO::PARAM_INPUT_OUTPUT,4); $ds->execute(); I've created a class to handle this kind of request. You can see it here - http://raxanpdi.com/sdk/docs/database.html http://php.net/manual/en/ref.pdo-dblib.php

« previous php.notes (#174760) next »