Jump to content

List tables in a database?


Perad

Recommended Posts

try

<?php
$cnx = mysql_connect('localhost', '****', '*****');
mysql_select_db('****');

$tables = array();
$res = mysql_query("SHOW TABLES");
while ($r = mysql_fetch_row($res))
{
    $tables[] = $r[0];
}
echo '<pre>', print_r($tables, true), '</pre>';
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.