#40588 [Opn->Fbk]: mysqli_connect_error() == "" on error

From: Date: Thu, 22 Feb 2007 10:59:28 +0000
Subject: #40588 [Opn->Fbk]: mysqli_connect_error() == "" on error
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-109316@lists.php.net to get a copy of this message
ID: 40588 Updated by: tony2001@php.net Reported By: frankpw at fw2s dot com -Status: Open +Status: Feedback Bug Type: MySQLi related Operating System: Win XP Pro PHP Version: 5.2.1 New Comment: Cannot reproduce. Make sure the client library is of the same version is the MySQL server. Previous Comments: ------------------------------------------------------------------------ [2007-02-22 04:45:41] frankpw at fw2s dot com Description: ------------ In my class I'm opening a connection with mysqli_connect(). mysqli_connect_error() returns description of any error except one. If one parameter is of wrong type (i.e port as string rather than numeric). Reproduce code: --------------- public function OpenConnection($host, $user, $pass, $name = null, $port = null, $sock = null, $chrs = null) { $this->mysqli = @mysqli_connect($host, $user, $pass, $name, $port, $sock); if (empty($this->mysqli)) die ("Execution stopped! " . mysqli_connect_error() . "<br />\n"); if (!empty($chrs)) $this->DefaultCharacterSet($chrs); } Expected result: ---------------- "Execution stopped! mysqli_connect expects parameter 5 to be long, string given" Actual result: -------------- "Execution stopped!" ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=40588&edit=1

« previous php.bugs (#109316) next »