From dae3964e7682dcd0d64075dfc28a23c12ef6c52e Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Sat, 14 Jan 2017 02:26:28 -0500 Subject: Reset working directory for clean Scrott implementation --- app/class/database.class.php | 73 ------------------------------------------- app/class/mysql.class.php | 74 -------------------------------------------- 2 files changed, 147 deletions(-) delete mode 100644 app/class/database.class.php delete mode 100644 app/class/mysql.class.php (limited to 'app/class') diff --git a/app/class/database.class.php b/app/class/database.class.php deleted file mode 100644 index c7ef65b..0000000 --- a/app/class/database.class.php +++ /dev/null @@ -1,73 +0,0 @@ -esc($guid); - $query = "SELECT * FROM " . $table . " WHERE guid = '" . $guid . "'"; - $res = $this->query($query); - - if (!count($res)) - return; - - $res = $res[0]; - - foreach ($fields as $field) - { - if (isset($res[$field])) - $this->$field = $res[$field]; - } - } -} - -?> diff --git a/app/class/mysql.class.php b/app/class/mysql.class.php deleted file mode 100644 index 90a4016..0000000 --- a/app/class/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