summaryrefslogtreecommitdiff
path: root/classes/db
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2016-08-21 14:03:35 +0300
committerAndrew Dolgov <[email protected]>2016-08-21 14:03:35 +0300
commite54eb40a8c1ec9fe9387611d890d195f511a4180 (patch)
tree93000c8799b2f0b5e5a79238485b00afb476abde /classes/db
parenta005ebb693fe9ad01eb2cb2293e75c589a00d6a0 (diff)
remove support for legacy mysql driver
Diffstat (limited to 'classes/db')
-rw-r--r--classes/db/mysql.php81
1 files changed, 0 insertions, 81 deletions
diff --git a/classes/db/mysql.php b/classes/db/mysql.php
deleted file mode 100644
index e8701f7bb..000000000
--- a/classes/db/mysql.php
+++ /dev/null
@@ -1,81 +0,0 @@
-<?php
-class Db_Mysql implements IDb {
- private $link;
- private $last_error;
-
- function connect($host, $user, $pass, $db, $port) {
- $this->link = mysql_connect($host, $user, $pass);
-
- if ($this->link) {
- $result = mysql_select_db($db, $this->link);
- if (!$result) {
- die("Can't select DB: " . mysql_error($this->link));
- }
-
- $this->init();
-
- return $this->link;
- } else {
- die("Unable to connect to database (as $user to $host, database $db): " . mysql_error());
- }
- }
-
- function escape_string($s, $strip_tags = true) {
- if ($strip_tags) $s = strip_tags($s);
-
- return mysql_real_escape_string($s, $this->link);
- }
-
- function query($query, $die_on_error = true) {
- $result = @mysql_query($query, $this->link);
- if (!$result) {
- $this->last_error = @mysql_error($this->link);
-
- @mysql_query("ROLLBACK", $this->link);
- user_error("Query $query failed: " . ($this->link ? $this->last_error : "No connection"),
- $die_on_error ? E_USER_ERROR : E_USER_WARNING);
- }
- return $result;
- }
-
- function fetch_assoc($result) {
- return mysql_fetch_assoc($result);
- }
-
-
- function num_rows($result) {
- return mysql_num_rows($result);
- }
-
- function fetch_result($result, $row, $param) {
- return mysql_result($result, $row, $param);
- }
-
- function close() {
- return mysql_close($this->link);
- }
-
- function affected_rows($result) {
- return mysql_affected_rows($this->link);
- }
-
- function last_error() {
- return mysql_error();
- }
-
- function last_query_error() {
- return $this->last_error;
- }
-
- function init() {
- $this->query("SET time_zone = '+0:0'");
-
- if (defined('MYSQL_CHARSET') && MYSQL_CHARSET) {
- $this->query("SET NAMES " . MYSQL_CHARSET);
- }
-
- return true;
- }
-
-}
-?>