some cleanup on the mysqli driver
This commit is contained in:
parent
78e4b64c8b
commit
2e7028c976
@ -10,14 +10,20 @@ class dba_mysqli extends dba_driver {
|
|||||||
else
|
else
|
||||||
$this->db = new mysqli($server,$user,$pass,$db);
|
$this->db = new mysqli($server,$user,$pass,$db);
|
||||||
|
|
||||||
if(! mysqli_connect_errno()) {
|
if($this->db->connect_error) {
|
||||||
$this->connected = true;
|
$this->connected = false;
|
||||||
|
$this->error = $this->db->connect_error;
|
||||||
|
|
||||||
|
if(file_exists('dbfail.out')) {
|
||||||
|
file_put_contents('dbfail.out', datetime_convert() . "\nConnect: " . $this->error . "\n", FILE_APPEND);
|
||||||
}
|
}
|
||||||
if($this->connected) {
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$this->connected = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
$this->error = $this->db->connect_error;
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function q($sql) {
|
function q($sql) {
|
||||||
|
Reference in New Issue
Block a user