Since PHP 7.2: db2_execute():Value Not Bound

Issue #20 new
Former user created an issue

After I updated Zend on our IBM i server. We have many problems if we are using php version 7.2 or 7.3. PHP version 7.1 is still working fine.

test1();

function test1() { 

$sql = "CALL

mylib.mypgm (?, ?, ?, ?)";
$user = 'PROUZA';
$app = 'VALUE1';
$autOK = '';
$message = '';

$db =db2_connect('*LOCAL', 'myuser', 'mypassword');

$stmt = db2_prepare($db, $sql);

db2_bind_param ($stmt, 1, "user", DB2_PARAM_IN, DB2_CHAR );
db2_bind_param ($stmt, 2, "app", DB2_PARAM_IN, DB2_CHAR );
db2_bind_param ($stmt, 3, "autOK", DB2_PARAM_INOUT, DB2_CHAR );
db2_bind_param ($stmt, 4, "message", DB2_PARAM_INOUT, DB2_CHAR );
db2_execute($stmt);

}

Here we get the error message:

Warning: db2_execute(): Value Not Bound in myfile.php on line 20.

I figured out, that if we run this code in a single php script, everything is working fine. But as soon as this code is put into a function (like test1() in the sample above), we receive the error.

https://bugs.php.net/bug.php?id=77846

http://forums.zend.com/viewtopic.php?f=77&t=135939

https://gist.github.com/ushiday/4b59493da3b6bd4fe14f91231796a11a

Comments (0)

  1. Log in to comment