diff --git a/VERSION b/VERSION index ee90284..90a27f9 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.4 +1.0.5 diff --git a/src/Database.php b/src/Database.php index 1002b79..7cbf8c3 100644 --- a/src/Database.php +++ b/src/Database.php @@ -389,9 +389,10 @@ public function insert($query = "" , $params = []) { // Log any errors and throw an exception $this->Logger->error($e->getMessage()); - throw New Exception( $e->getMessage() ); + + // Return + return false; } - return false; } /** @@ -694,6 +695,36 @@ public function getTable($table) { } } + /** + * Retrieve the tables in the database. + * + * @return array + * @throws Exception + */ + public function getTables() { + try { + + // Retrieve the tables in the database + $result = $this->connection->query("SHOW TABLES"); + + // Initialize the tables array + $tables = array(); + + // Generate the tables array + while ($row = $result->fetch_row()) { + $tables[] = $row[0]; + } + + // Return the array of tables + return $tables; + } catch(Exception $e) { + + // Log any errors and throw an exception + $this->Logger->error($e->getMessage()); + throw new Exception($e->getMessage()); + } + } + /** * Retrieve the columns of a table. *