$this->db->_error_message() not return error for Mysqli driver #1765

Closed
lighta971 opened this Issue Sep 3, 2012 · 2 comments

Comments

Projects
None yet
2 participants

An error rise when i try to test an connection error to my database when i use Mysqli driver.

$db['default']['db_debug'] = FALSE;
$db['default']['dbdriver'] = 'mysqli';
//And i make a fault on my login config to test the error.
$db['default']['username'] = '67fgdg67fgoi';

Test code:

if($this->db->_error_message()) { ... }

A PHP Error was encountered

Severity: Warning

Message: mysqli_error() expects parameter 1 to be mysqli, boolean given

Filename: mysqli/mysqli_driver.php

Line Number: 458

I solved this bug by:

if( @ $this->db->_error_message()  || mysqli_connect_error()) { .. }
Contributor

narfbg commented Oct 5, 2012

What PHP version are you using?

narfbg added a commit that referenced this issue Oct 5, 2012

Contributor

narfbg commented Oct 5, 2012

Nevermind - fixed it in develop.

@narfbg narfbg closed this Oct 5, 2012

nonchip pushed a commit to nonchip/CodeIgniter that referenced this issue Jun 29, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment