示例#1
0
 /**
  * An alias of mysql_list_tables.
  *
  * @return array returns the table list, specified in the database
  * @param string $db_name - the database name
  * @param resource $link - the connection id
  */
 function DB_List_Tables($db_name)
 {
     if (!isset(self::$table_list_cache) || self::$table_list_cache == null) {
         self::$table_list_cache = array();
         $tables = DB_MySQL::DB_Query("SHOW TABLES FROM `{$db_name}`");
         while ($table = DB_MySQL::DB_Fetch_Array($tables, QUERY_RESULT_NUM)) {
             self::$table_list_cache[$table[0]] = true;
         }
     }
     return self::$table_list_cache;
 }