Bug #73963 [Fbk->NoF]: mysqli_connect returns old object for invalid connection

From: Date: Sun, 29 Jan 2017 04:22:58 +0000
Subject: Bug #73963 [Fbk->NoF]: mysqli_connect returns old object for invalid connection
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-207031@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73963&edit=1 ID: 73963 Updated by: php-bugs@lists.php.net Reported by: thamizh82 at gmail dot com Summary: mysqli_connect returns old object for invalid connection -Status: Feedback +Status: No Feedback Type: Bug Package: MySQLi related Operating System: Linux PHP Version: 5.6.30 Private report: N New Comment: No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Re-Opened". Thank you. Previous Comments: ------------------------------------------------------------------------ [2017-01-20 16:09:41] requinix@php.net NULL for the host will assume localhost (which is documented), so mysqli_connect("localhost", $user, $pass) mysqli_connect(NULL, $user, $pass) are the same. The only thing suspicious is mysqli_connect("NULL", $user, $pass) Are you absolutely certain that passing the string "NULL" gives you a working connection? (And your system isn't resolving it to localhost.) The connection might be reused - what if you don't connect successfully earlier? ------------------------------------------------------------------------ [2017-01-20 14:26:32] thamizh82 at gmail dot com Description: ------------ --- From manual page: http://www.php.net/function.mysqli-connect --- $con=mysqli_connect("localhost","my_user","my_password","my_db"); var_dump($con); -> Return mysql object. $conn = mysqli_connect(NULL, $user, $pass); $conn = mysqli_connect('NULL', $user, $pass); Return Same/old object given before. Not thrown false or error. $conn = mysqli_connect('NULLTest', $user, $pass); Return false Test script: --------------- $con=mysqli_connect("localhost","my_user","my_password","my_db"); var_dump($con); -> Return mysql object. $conn = mysqli_connect(NULL, $user, $pass); $conn = mysqli_connect('NULL', $user, $pass); Return Same object given before. Not thrown false or error. $conn = mysqli_connect('NULLTest', $user, $pass); Return false Expected result: ---------------- $conn = mysqli_connect(NULL, $user, $pass); Should return false. Actual result: -------------- $conn = mysqli_connect(NULL, $user, $pass); var_dump($con); -> Return mysql object. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=73963&edit=1

« previous php.bugs (#207031) next »