aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2016-04-26 11:41:23 +0200
committerMario Vavti <mario@mariovavti.com>2016-04-26 11:41:23 +0200
commitce50a429fab4b44131ab852c72bf0d57a5958d2d (patch)
tree3d9e89cb50e21593f4381587151d83908585e16d /include
parent3446e68ac2aa3f970307b748fee5ee2da1af4ca4 (diff)
parente508ad37c15a5c3c10bf0e6c117fe24859892acf (diff)
downloadvolse-hubzilla-ce50a429fab4b44131ab852c72bf0d57a5958d2d.tar.gz
volse-hubzilla-ce50a429fab4b44131ab852c72bf0d57a5958d2d.tar.bz2
volse-hubzilla-ce50a429fab4b44131ab852c72bf0d57a5958d2d.zip
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev
Diffstat (limited to 'include')
-rwxr-xr-xinclude/dba/dba_mysqli.php18
1 files changed, 12 insertions, 6 deletions
diff --git a/include/dba/dba_mysqli.php b/include/dba/dba_mysqli.php
index 6986d4586..57a7559a1 100755
--- a/include/dba/dba_mysqli.php
+++ b/include/dba/dba_mysqli.php
@@ -4,20 +4,26 @@ require_once('include/dba/dba_driver.php');
class dba_mysqli extends dba_driver {
- function connect($server, $port, $user,$pass,$db) {
+ function connect($server,$port,$user,$pass,$db) {
if($port)
$this->db = new mysqli($server,$user,$pass,$db, $port);
else
$this->db = new mysqli($server,$user,$pass,$db);
- if(! mysqli_connect_errno()) {
- $this->connected = true;
+ if($this->db->connect_error) {
+ $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);
+ }
+
+ return false;
}
- if($this->connected) {
+ else {
+ $this->connected = true;
return true;
}
- $this->error = $this->db->connect_error;
- return false;
}
function q($sql) {