From b90ae2cc8da4014b3bbec03fc4b43c83f3e7cfc7 Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Sun, 15 Jan 2017 22:45:43 -0500 Subject: Purge old content --- examples/class/database.iface.php | 27 -------------- examples/class/mysql.class.php | 77 --------------------------------------- examples/mysql.class.php | 74 ------------------------------------- 3 files changed, 178 deletions(-) delete mode 100644 examples/class/database.iface.php delete mode 100644 examples/class/mysql.class.php delete mode 100644 examples/mysql.class.php diff --git a/examples/class/database.iface.php b/examples/class/database.iface.php deleted file mode 100644 index b1427a4..0000000 --- a/examples/class/database.iface.php +++ /dev/null @@ -1,27 +0,0 @@ - diff --git a/examples/class/mysql.class.php b/examples/class/mysql.class.php deleted file mode 100644 index f8f456a..0000000 --- a/examples/class/mysql.class.php +++ /dev/null @@ -1,77 +0,0 @@ -db = new mysqli($host, $username, $password, $dbName); - - if ($this->db->connect_error) - throw new Exception("Can not connect to Mysql database. Please check your Scrott configuration."); - } - - /* - * Destructor - */ - function __destruct() - { - $this->close(); - } - - /* - * Close connection to DB - */ - function close() - { - $this->db->close(); - } - - /* - * Make a query of the database. Return data as an array of arrays - */ - function query($query) - { - $arr = array(); - $res = $this->db->query($query); - - if ($res === true || $res === false) - return $arr; - - while ($r = $res->fetch_assoc()) - $arr[] = $r; - - return $arr; - } - - /* - * Escape a string for use in a query - */ - function esc($string) - { - return $this->db->real_escape_string($string); - } -} - -?> diff --git a/examples/mysql.class.php b/examples/mysql.class.php deleted file mode 100644 index 90a4016..0000000 --- a/examples/mysql.class.php +++ /dev/null @@ -1,74 +0,0 @@ -db = new mysqli($host, $username, $password, $dbName); - - if ($this->db->connect_error) - throw new Exception("Can not connect to MySQL database. Please check your configuration."); - } - - /* - * Destructor - */ - public function __destruct() - { - $this->close(); - } - - /* - * Close connection to DB - */ - public function close() - { - $this->db->close(); - } - - /* - * Make a query of the database. Return data as an array of arrays. - */ - public function query(string $query) : array - { - $arr = array(); - $res = $this->db->query($query); - - if ($res === true || $res === false) - return $arr; - - while (($arr[] = $res->fetch_assoc())); - return $arr; - } - - /* - * Escape a string for use in a query - */ - public function esc(string $str) : string - { - return $this->db->real_escape_string($str); - } -} - -?> -- cgit v1.2.3