Home > Backend Development > PHP Tutorial > php lists all tables in the database specified by mysql

php lists all tables in the database specified by mysql

WBOY
Release: 2016-07-25 08:42:55
Original
740 people have browsed it

php lists all tables in the database specified by mysql

  1. if (!function_exists('mysql_list_db_tables')) {
  2. function mysql_list_db_tables($database) {
  3. $tables = Array();
  4. $resul ts = mysql_query('SHOW TABLES FROM ' . $database);
  5. while($row = @mysql_fetch_assoc($results)) { $tables[] = $row['Tables_in_' . $database]; }
  6. return $tables;
  7. }
  8. }
Copy code

Database, php, mysql


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template