Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $db_username = '';
- $db_password = '';
- $db = new mysqli ('localhost', $db_username, $db_password);
- echo "---------------- ---------------------\;";
- // Get Database List
- $query_getDB = $db->query( "SHOW DATABASES" );
- //$db_list = array();
- while ( $result_db = $query_getDB->fetch_object()) {
- mysqli_select_db( $db, (string)$result_db->Database );
- $query_getTables = $db->query( "SHOW TABLES" );
- if ( ( $result_db->Database == 'information_schema' ) || ( $result_db->Database == 'mysql' ) ) {}
- else {
- while ( $result_tables = $query_getTables->fetch_array() ) {
- //print_r($result_tables);
- $sql_total = sprintf( "SELECT COUNT(*) AS `total` FROM `%s`", $result_tables[0] );
- $query_total = $db->query( $sql_total );
- while ( $result_total = $query_total->fetch_object() ) {
- printf( "%s: %d\n", $result_tables[0], $result_total->total );
- }
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement