diff --git a/src/Pluf/DB/Introspect/MySQL.php b/src/Pluf/DB/Introspect/MySQL.php new file mode 100644 index 0000000..3322c9f --- /dev/null +++ b/src/Pluf/DB/Introspect/MySQL.php @@ -0,0 +1,50 @@ +db = $db; + } + + /** + * Get the list of tables in the current database. + * + * @param object DB connection. + * @return array List of tables. + */ + function listTables() + { + $sql = 'SHOW TABLES'; + $res = $this->db->select($sql); + $tables = array(); + foreach ($res as $t) { + $tables[] = array_pop($t); + } + return $tables; + } +} \ No newline at end of file