News:

Please note these forums are mostly a testing ground for my SMF work and I don't really use them otherwise.

Main Menu

Paste-1181706960:v:use_geshi-1:v:type-php

Started by Guest, Jun 13, 2007, 03:56 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Guest

// List all the tables in the database.
function db_list_tables($db = false, $filter = false)
{
   global $db_name, $smfFunc;

   $db = $db == false ? $db_name : $db;
   $filter = $filter == false ? '' : " LIKE $filter";

   $request = $smfFunc['db_query']('', "
      SHOW TABLES
      FROM $db
      $filter", false, false);
   $tables = array();
   while ($row = $smfFunc['db_fetch_row']($request))
      $tables[] = $row[0];
   $smfFunc['db_free_result']($request);

   return $tables;
}