note 101911 deleted from function.empty by cmb

From: Date: Fri, 26 Apr 2019 16:54:32 +0000
Subject: note 101911 deleted from function.empty by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-210679@lists.php.net to get a copy of this message
Note Submitter: christian dot achatz at adventure-php-framework dot org ---- Since this special case is not mentioned already: the empty() check does not work for mysqli resources / connections stored within a private variable. Instead of if(!empty($this->dbConn->error)){...} you have to use $error = $this->dbConn->error; if(!empty($error)){...} otherwise the condition will not evaluate to true in case a mysqli error is given for the present connection.

« previous php.notes (#210679) next »