i got a problem with executing a stored procedure in zend framework. Before this problem, i was using dblib and everything was perfect. Here's the code:
$stmt = $this->_db->prepare( "EXEC getParam ? , ?");
$stmt->bindParam( 1, $param['serial'] );
$stmt->bindParam( 2, $renderXml );
$stmt->execute();
$data = $stmt->fetchAll();
Now, i changed my driver from dblib to sqlsrv (runinng via wamp 32 bit) and i have following problem:
Microsoft][SQL Server Native Client 11.0]COUNT field incorrect or syntax error' in >..\Sqlsrv.php:206>
I searched for solution, but always everything was like my first solution that was working, before i changed sql driver.
Personnaly I use this method to call a sored procedure:
To call getParam() with two string parameters
$proc = "CALL getParam(:param1, :param2)";
$stmt = $this->_db->prepare($proc);
$stmt->bindParam(':param1', $param['serial'], PDO::PARAM_STR);
$stmt->bindParam(':param2', $renderXml , PDO::PARAM_STR);
$stmt->execute();
$data = $stmt->fetchAll();
I hope it's can help you. :)