. /** * @package MantisBT * @copyright Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org * @copyright Copyright (C) 2002 - 2014 MantisBT Team - mantisbt-dev@lists.sourceforge.net * @link http://www.mantisbt.org */ /** * MantisBT Core API's */ require_once( dirname( dirname( __FILE__ ) ) . DIRECTORY_SEPARATOR . 'core.php' ); access_ensure_global_level( config_get_global( 'admin_site_threshold' ) ); # -------------------- function helper_table_row_count( $p_table ) { $t_table = $p_table; $t_query = "SELECT COUNT(*) FROM $t_table"; $t_result = db_query_bound( $t_query ); $t_count = db_result( $t_result ); return $t_count; } # -------------------- function print_table_stats( $p_table_name ) { $t_count = helper_table_row_count( $p_table_name ); echo "$p_table_name = $t_count records
"; } echo 'MantisBT Database Statistics'; echo '

MantisBT Database Statistics

'; foreach( db_get_table_list() as $t_table ) { if( db_table_exists( $t_table ) ) { print_table_stats( $t_table ); } } echo '';