Toms Homepage
  Home    Downloads    Your Account    Forums  
  Create an account
Modules
· Home
· Games
· My Gallery
· PHP Manual
· PHP-Nuke HOWTO
· Web Links
· Your Account
 
Who's Online
Welcome, Anonymous
Nickname

Password

Security Code
Security Code
Type Security Code


(Register)

Membership:
Latest: MillardKi
New Today: 366
New Yesterday: 650
Overall: 45702

People Online:
Visitors: 182
Members: 10
Total: 192

Online Now:
 AvisChris
COM BrandonKn
COM TiffinyLF
COM HaleyHeff
COM LeilaDonn
COM Jerry45Q
 RolandeAllen82
COM EvieFerre
COM OfeliaMcm
COM TimothyT5
 
mysql_list_tables

mysql_list_tables

(PHP 3, PHP 4 , PHP 5)

mysql_list_tables -- List tables in a MySQL database

Description

resource mysql_list_tables ( string database [, resource link_identifier] )

mysql_list_tables() takes a database name and returns a result pointer much like the mysql_query() function. Use the mysql_tablename() function to traverse this result pointer, or any function for result tables, such as mysql_fetch_array().

The database parameter is the name of the database to retrieve the list of tables from. Upon failure, mysql_list_tables() returns FALSE.

For downward compatibility, the function alias named mysql_listtables() can be used. This is deprecated however and is not recommended.

Note: The function mysql_list_tables() is deprecated. It is preferable to use mysql_query() to issue a SQL SHOW TABLES [FROM db_name] [LIKE 'pattern'] statement instead.

Example 1. mysql_list_tables() example

<?php
$dbname
= 'mysql_dbname';

if (!
mysql_connect('mysql_host', 'mysql_user', 'mysql_password')) {
    echo
'Could not connect to mysql';
    exit;
}

$result = mysql_list_tables($dbname);

if (!
$result) {
    echo
"DB Error, could not list tables\n";
    echo
'MySQL Error: ' . mysql_error();
    exit;
}

while (
$row = mysql_fetch_row($result)) {
    echo
"Table: $row[0]\n";
}

mysql_free_result($result);
?>


See also mysql_list_dbs() and mysql_tablename().

All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest © 2004 by Tom Nitzschner.
Web site engine code is Copyright © 2003 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.163 Seconds

:: VereorLCARS phpbb2 style by Vereor :: PHP-Nuke theme by www.nukemods.com ::