|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64640 PDO can't get output parameter value
Submitted: 2013-04-12 07:31 UTC Modified: 2016-11-11 19:27 UTC
Avg. Score:4.1 ± 0.9
Reproduced:7 of 7 (100.0%)
Same Version:2 (28.6%)
Same OS:0 (0.0%)
From: shllove at hotmail dot com Assigned:
Status: Not a bug Package: PDO Core
PHP Version: 5.4.14 OS: winxp sp3
Private report: No CVE-ID: None
 [2013-04-12 07:31 UTC] shllove at hotmail dot com
From manual page:

Test script:
                $sql = "call `SP_Test`(?)";
		$stmt = $this->db->prepare($sql);
		$stmt->bindParam(1, $cnt, PDO::PARAM_INPUT_OUTPUT | PDO::PARAM_INT , 11);
		$rt = $stmt->fetchAll();

		echo "cnt: $cnt";
		echo "cnt: $cnt";

out resultCount int

     set resultCount=10;          


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' 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2014-01-01 12:33 UTC]
-Package: PDO related +Package: PDO Core
 [2016-11-11 19:27 UTC]
-Status: Open +Status: Not a bug
 [2016-11-11 19:27 UTC]
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.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 20 21:01:34 2024 UTC