Bug #64640 [Opn->Nab]: PDO can't get output parameter value

From: Date: Fri, 11 Nov 2016 19:27:11 +0000
Subject: Bug #64640 [Opn->Nab]: PDO can't get output parameter value
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-205315@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=64640&edit=1 ID: 64640 Updated by: adambaratz@php.net Reported by: shllove at hotmail dot com Summary: PDO can't get output parameter value -Status: Open +Status: Not a bug Type: Bug Package: PDO Core Operating System: winxp sp3 PHP Version: 5.4.14 Block user comment: N Private report: N New Comment: The error returned is a SQL syntax error. I tried running the CREATE query in SQL Server Management Studio -- I assume from the error you're using MSSQL -- and got a syntax error. So I don't think PDO has anything to do with the problem you're having. Previous Comments: ------------------------------------------------------------------------ [2013-04-12 07:31:15] shllove at hotmail dot com Description: ------------ --- From manual page: http://www.php.net/pdostatement.bindparam#refsect1-pdostatement.bindparam-description --- Test script: --------------- $sql = "call SP_Test(?)"; $stmt = $this->db->prepare($sql); $stmt->bindParam(1, $cnt, PDO::PARAM_INPUT_OUTPUT | PDO::PARAM_INT , 11); $stmt->execute(); $rt = $stmt->fetchAll(); echo "cnt: $cnt"; $stmt->closeCursor(); echo "cnt: $cnt"; sp: CREATE PROCEDURE SP_Test( out resultCount int ) BEGIN set resultCount=10; END; Expected result: ---------------- cnt: 10 Actual result: -------------- Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1414 OUT or INOUT argument 1 for routine octpod.SP_Test is not a variable or NEW pseudo-variable in BEFORE trigger' ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=64640&edit=1

« previous php.bugs (#205315) next »