View / Download this file.
---------------------------------------
PTMDB MODULE - db_get_tables() FUNCTION
---------------------------------------
------------
USAGE FORMAT
------------
Where @tables is the returned list of table names:
@tables = &db_get_tables($db_object);
@tables = &db_get_tables($db_object, $db_name);
-----------
DESCRIPTION
-----------
Retreives the list of table names from the server. If a database has
already been selected, the only required parameter is the database object.
If a database has not been selected, or you wish to list tables from
another database, a database name is required as well. Returns an array
containing table names in the order in whcih they were returned from the
server.
---------
ARGUMENTS
---------
$db_object
REQUIRED
A database handler object. This object stores connection information and
is returned from a db_connect() function call. This object is of the same
type as is returned by a DBI->connect function call.
$db_name
OPTIONAL / REQUIRED
The name of the database from which to pull table names. This is only
required if a database has not yet been selected using the
db_select_database() function or an SQL 'USE' statement, or alternately if
you wish to pull table names from a different database than the one
currently selected.
-------
RETURNS
-------
A list (array) of table names from the selected database.
--------------
USAGE EXAMPLES
--------------
-----------------------------------------------------------------------
Example 1: Display the Table Names from the Currently Selected Database
-----------------------------------------------------------------------
<?= join(', ', &db_get_tables($dbobj)) =?>
|