Bug #77933 [NEW]: Unable to get Parameter Out

From: Date: Tue, 23 Apr 2019 17:21:51 +0000
Subject: Bug #77933 [NEW]: Unable to get Parameter Out
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-220575@lists.php.net to get a copy of this message
From: jose dot castro at stccorp dot net Operating system: Windows 10 PHP version: 7.2.17 Package: PDO MySQL Bug Type: Bug Bug description:Unable to get Parameter Out Description: ------------ $outdata = 0; $stmt = $pdo->prepare("CALL sp_insert_test(?,?,?,?,?,?)"); $stmt->bindParam(1, $d1, PDO::PARAM_INT); $stmt->bindParam(2, $dtype, PDO::PARAM_STR); $stmt->bindParam(3, $d2, PDO::PARAM_INT); $stmt->bindParam(4, $d3, PDO::PARAM_INT); $stmt->bindParam(5, $title, PDO::PARAM_STR); $stmt->bindParam(6, $newid, PDO::PARAM_INT|PDO::PARAM_INPUT_OUTPUT); $stmt->execute(); echo "NEW IS IS : . $newid; Test script: --------------- CREATE TABLE test_table ( tid int(10) unsigned NOT NULL AUTO_INCREMENT, d1 int(10) unsigned DEFAULT NULL, dtype varchar(10) DEFAULT NULL, d2 int(10) unsigned DEFAULT NULL, d3 int(10) unsigned DEFAULT NULL, title varchar(200) DEFAULT NULL, dateCreated datetime NOT NULL, dateUpdated timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (tid), ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; CREATE PROCEDURE sp_insert_test(IN p_d1 INT,IN p_dtype VARCHAR(10),IN p_d2 INT,IN p_d3 INT,IN p_title VARCHAR(200), OUT p_out INT) BEGIN INSERT INTO test_table (d1,dtype,d2,d3,title,dateCreated) values (p_d1,p_dtype,p_d2,p_d3,p_title,NOW()); SELECT LAST_INSERT_ID() INTO p_out; END Expected result: ---------------- Expected the last id of the table Additional info: MYSQL version: 5.7.19 Actual result: -------------- always get 0 -- Edit bug report at https://bugs.php.net/bug.php?id=77933&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=77933&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=77933&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=77933&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=77933&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=77933&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=77933&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=77933&r=needscript Try newer version: https://bugs.php.net/fix.php?id=77933&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=77933&r=support Expected behavior: https://bugs.php.net/fix.php?id=77933&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=77933&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=77933&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=77933&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=77933&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=77933&r=dst IIS Stability: https://bugs.php.net/fix.php?id=77933&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=77933&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=77933&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=77933&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=77933&r=mysqlcfg

« previous php.bugs (#220575) next »