|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-05-25 16:24 UTC] opendev at us dot ibm dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 17:00:01 2025 UTC |
Description: ------------ If you use the same variable name for prepared statements with in the same block of code a PHP warning is produced and the execute statement will fail on the second prepare statement. Reproduce code: --------------- <?php $db2conn = db2_connect("SAMPLE", "", ""); $query = "Select TABLE_CATALOG, TABLE_NAME From SYSIBM.TABLES"; $stmt = db2_prepare($db2conn, $query); if(db2_execute($stmt)) { $a_result = db2_fetch_both($stmt); print("\n" . $a_result[0] . "." . $a_result[1] . "\n\n"); } db2_free_result($stmt); db2_free_stmt($stmt); $query = "Select TABLE_CATALOG, TABLE_NAME From SYSIBM.TABLES"; $stmt = db2_prepare($db2conn, $query); if(db2_execute($stmt)) { $a_result = db2_fetch_both($stmt); print("\n" . $a_result[0] . "." . $a_result[1] . "\n\n"); } db2_free_result($stmt); db2_free_stmt($stmt); ?> Expected result: ---------------- SAMPLE.CATALOG SAMPLE.CATALOG Actual result: -------------- SAMPLE.CATALOG Warning: db2_execute(): More parameters bound than present in C:\testbed\SameNameTest.php on line 18 Warning: db2_execute(): Parameters not bound in C:\testbed\SameNameTest.php on line 18