aboutsummaryrefslogtreecommitdiffstats
path: root/include/dba/dba_mysqli.php
diff options
context:
space:
mode:
authorAndrew Manning <tamanning@zoho.com>2016-04-27 05:56:19 -0400
committerAndrew Manning <tamanning@zoho.com>2016-04-27 05:56:19 -0400
commitf975d9dfe457cb6912e7e0907406a86556537524 (patch)
tree10c02ebfbd5f2acf1f2944b0f28f7c97c4b8454a /include/dba/dba_mysqli.php
parentf027bf81cdaddee5d6474199c1b7adce50e6e07d (diff)
parenta6baa5a6da5f5231c119cab3170f68cf271f703b (diff)
downloadvolse-hubzilla-f975d9dfe457cb6912e7e0907406a86556537524.tar.gz
volse-hubzilla-f975d9dfe457cb6912e7e0907406a86556537524.tar.bz2
volse-hubzilla-f975d9dfe457cb6912e7e0907406a86556537524.zip
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into help-content
Diffstat (limited to 'include/dba/dba_mysqli.php')
-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) {