Bug #78932 [NEW]: mysqli_prepare oddity

From: Date: Sun, 08 Dec 2019 21:27:49 +0000
Subject: Bug #78932 [NEW]: mysqli_prepare oddity
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-224144@lists.php.net to get a copy of this message
From: craig at craigfrancis dot co dot uk Operating system: PHP version: 7.4.0 Package: MySQLi related Bug Type: Bug Bug description:mysqli_prepare oddity Description: ------------ When running the following test script, the error is not correctly shown. But if you un-commented the $statement = false line, then it works. It's as though the $statement variable is not being properly replaced. Test script: --------------- <?php $link = mysqli_connect('localhost', 'username', 'password', 'database'); $statement = mysqli_prepare($link, 'SELECT 1'); // $statement = false; $statement = mysqli_prepare($link, 'SELECT 1 FROM this_table_does_not_exist'); if (!$statement) { exit(mysqli_errno($link) . ': ' . mysqli_error($link)); } ?> Expected result: ---------------- 1146: Table 'database.this_table_does_not_exist' doesn't exist Actual result: -------------- 0: -- Edit bug report at https://bugs.php.net/bug.php?id=78932&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=78932&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=78932&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=78932&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=78932&r=needscript Try newer version: https://bugs.php.net/fix.php?id=78932&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=78932&r=support Expected behavior: https://bugs.php.net/fix.php?id=78932&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=78932&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=78932&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=78932&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=78932&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=78932&r=dst IIS Stability: https://bugs.php.net/fix.php?id=78932&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=78932&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=78932&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=78932&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=78932&r=mysqlcfg

« previous php.bugs (#224144) next »