Doc #80529 [NEW]: $mysqli->connect_errno may not work

From: Date: Thu, 17 Dec 2020 18:18:21 +0000
Subject: Doc #80529 [NEW]: $mysqli->connect_errno may not work
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-18278@lists.php.net to get a copy of this message
From: bugs dot php dot net at latter dot org Operating system: PHP version: Irrelevant Package: MySQLi related Bug Type: Documentation Problem Bug description:$mysqli->connect_errno may not work Description: ------------ --- From manual page: https://php.net/mysqli.construct --- This example code is given (as below) but if mysqli() returns false (as it will if for example the specified database does not exist) then $mysqli->connect_errno will generate a PHP warning of "Trying to get property 'connect_errno' of non-object". $mysqli = @new mysqli('localhost', 'fake_user', 'my_password', 'my_db'); if ($mysqli->connect_errno) { die('Connect Error: ' . $mysqli->connect_errno); } -- Edit bug report at https://bugs.php.net/bug.php?id=80529&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=80529&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=80529&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=80529&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=80529&r=needscript Try newer version: https://bugs.php.net/fix.php?id=80529&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=80529&r=support Expected behavior: https://bugs.php.net/fix.php?id=80529&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=80529&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=80529&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=80529&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=80529&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=80529&r=dst IIS Stability: https://bugs.php.net/fix.php?id=80529&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=80529&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=80529&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=80529&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=80529&r=mysqlcfg

« previous php.doc.bugs (#18278) next »