php lists all tables in the database specified by mysql
- if (!function_exists('mysql_list_db_tables')) {
-
- function mysql_list_db_tables($database) {
-
- $tables = Array();
-
- $resul ts = mysql_query('SHOW TABLES FROM ' . $database);
- while($row = @mysql_fetch_assoc($results)) { $tables[] = $row['Tables_in_' . $database]; }
-
- return $tables;
-
- }
-
- }
Copy code
|