php.net |  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
Votes:9
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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: shllove at hotmail dot com
New email:
PHP Version: OS:

 

 [2013-04-12 07:31 UTC] 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' 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-01-01 12:33 UTC] felipe@php.net
-Package: PDO related +Package: PDO Core
 [2016-11-11 19:27 UTC] adambaratz@php.net
-Status: Open +Status: Not a bug
 [2016-11-11 19:27 UTC] adambaratz@php.net
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-2020 The PHP Group
All rights reserved.
Last updated: Thu Oct 22 14:01:23 2020 UTC