list of table and database in php mysql
<?php $con = mysql_connect ( 'localhost' , 'root' , '' ); mysql_select_db ( 'demo' , $con ); $sql = "SHOW TABLES FROM demo" ; $result = mysql_query ( $sql ); echo ' Total Table = ' . mysql_num_rows ( $result ); // list of table in database while ( $row = mysql_fetch_row ( $result )) { echo "<br> {$row[0]}\n" ; } mysql_free_result ( $result ); ?> <?php // list of database $dblist = mysql_query ( "SHOW DATABASES" ); echo '<br> Total Database :' . mysql_num_rows ( $dblist ) . '<br> ' ; while ( $row = mysql_fetch_assoc ( $dblist )) { echo $row [ 'Database' ] . "<br>" ; }