aboutsummaryrefslogtreecommitdiffstats
path: root/include/dba/dba_mysqli.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2018-03-09 11:12:18 +0100
committerMario <mario@mariovavti.com>2018-03-09 11:12:18 +0100
commit4baf5eab16d809977a44e7911ddcab0ff8383897 (patch)
tree393f618c4cfc20f53264ecd8a26a08de0823d35d /include/dba/dba_mysqli.php
parent577da0eb9eb1f90a4cf7a70cfb3582cfb49007ac (diff)
parent7361af85b5488fc8bd1744389a3a332dc74276b0 (diff)
downloadvolse-hubzilla-3.2.tar.gz
volse-hubzilla-3.2.tar.bz2
volse-hubzilla-3.2.zip
Merge branch '3.2RC'3.2
Diffstat (limited to 'include/dba/dba_mysqli.php')
-rwxr-xr-xinclude/dba/dba_mysqli.php86
1 files changed, 0 insertions, 86 deletions
diff --git a/include/dba/dba_mysqli.php b/include/dba/dba_mysqli.php
deleted file mode 100755
index 165c8e969..000000000
--- a/include/dba/dba_mysqli.php
+++ /dev/null
@@ -1,86 +0,0 @@
-<?php /** @file */
-
-require_once('include/dba/dba_driver.php');
-
-class dba_mysqli extends dba_driver {
-
- function connect($server,$scheme,$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($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;
- }
- else {
- $this->connected = true;
- return true;
- }
- }
-
- function q($sql) {
- if((! $this->db) || (! $this->connected))
- return false;
-
- $this->error = '';
- $result = $this->db->query($sql);
-
- if($this->db->errno)
- $this->error = $this->db->error;
-
-
- if($this->error) {
- db_logger('dba_mysqli: ERROR: ' . printable($sql) . "\n" . $this->error, LOGGER_NORMAL, LOG_ERR);
- if(file_exists('dbfail.out')) {
- file_put_contents('dbfail.out', datetime_convert() . "\n" . printable($sql) . "\n" . $this->error . "\n", FILE_APPEND);
- }
- }
-
- if(($result === true) || ($result === false)) {
- if($this->debug) {
- db_logger('dba_mysqli: DEBUG: ' . printable($sql) . ' returns ' . (($result) ? 'true' : 'false'), LOGGER_NORMAL,(($result) ? LOG_INFO : LOG_ERR));
- }
- return $result;
- }
-
- if($this->debug) {
- db_logger('dba_mysqli: DEBUG: ' . printable($sql) . ' returned ' . $result->num_rows . ' results.', LOGGER_NORMAL, LOG_INFO);
- }
-
- $r = array();
- if($result->num_rows) {
- while($x = $result->fetch_array(MYSQLI_ASSOC))
- $r[] = $x;
- $result->free_result();
- if($this->debug) {
- db_logger('dba_mysqli: ' . printable(print_r($r,true)), LOGGER_NORMAL, LOG_INFO);
- }
- }
- return $r;
- }
-
- function escape($str) {
- if($this->db && $this->connected) {
- return @$this->db->real_escape_string($str);
- }
- }
-
- function close() {
- if($this->db)
- $this->db->close();
- $this->connected = false;
- }
-
- function getdriver() {
- return 'mysqli';
- }
-
-} \ No newline at end of file