Search code examples
phpmysqlkohana

Kohana - get all Tables by using DB::query


How can i recive all tables listet in my database by using DB::query in Kohana? I won't try mysqli_list_tables or something like this, because have to find a soultion in the framework.

The next query just give me the current count of the tables inside the database: $tablesAvailable = DB::query(NULL, "SHOW TABLES")->execute();

I need the values, not the integer. You can't use a select statement, because the DB Object expect explicit an table name for executing the query.

The function as_assoc() on the result ($tablesAvailable) makes the var to NULL. Any ideas so far?


Solution

  • foreach(Database::instance()->list_tables() as $table)
        {
            echo $table.'<br>';
        }