mysql> use mysql Database changed mysql> desc innodb_table_stats; +--------------------------+---------------------+------+-----+-------------------+-----------------------------+ | Field | Type | Null | Key | Default | Extra | +--------------------------+---------------------+------+-----+-------------------+-----------------------------+ | database_name | varchar(64) | NO | PRI | NULL | | | table_name | varchar(64) | NO | PRI | NULL | | | last_update | timestamp | NO | | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP | | n_rows | bigint(20) unsigned | NO | | NULL | | | clustered_index_size | bigint(20) unsigned | NO | | NULL | | | sum_of_other_index_sizes | bigint(20) unsigned | NO | | NULL | | +--------------------------+---------------------+------+-----+-------------------+-----------------------------+
mysql> select * from innodb_table_stats; +-----------------+----------------+---------------------+--------+----------------------+--------------------------+ | database_name | table_name | last_update | n_rows | clustered_index_size | sum_of_other_index_sizes | +-----------------+----------------+---------------------+--------+----------------------+--------------------------+ | fams | admin | 2016-07-19 14:47:02 | 3 | 1 | 0 | | fams | assets_in | 2016-07-14 14:42:44 | 2 | 1 | 3 | | fams | assets_out | 2016-07-14 20:14:31 | 4 | 1 | 3 | | fams | class | 2016-07-14 14:36:02 | 3 | 1 | 0 | | fams | dog | 2016-08-11 15:25:50 | 4 | 1 | 0 | | fams | fixed_assets | 2016-07-14 15:55:09 | 6 | 1 | 2 | | fams | sub_class | 2016-07-14 14:38:51 | 8 | 1 | 1 | | fams | user | 2016-07-14 14:15:59 | 2 | 1 | 0 | | mysql | gtid_executed | 2016-07-14 12:50:25 | 0 | 1 | 0 | | privilegesystem | privilege | 2016-08-08 08:56:21 | 3 | 1 | 0 | | privilegesystem | role | 2016-08-08 08:26:56 | 2 | 1 | 0 | | privilegesystem | role_privilege | 2016-08-08 09:51:04 | 2 | 1 | 1 | | privilegesystem | user | 2016-08-08 11:07:35 | 2 | 1 | 0 | | privilegesystem | user_role | 2016-08-08 11:08:15 | 2 | 1 | 2 | | sys | sys_config | 2016-07-14 12:50:30 | 6 | 1 | 0 | | test | datetest | 2016-07-19 10:02:38 | 2 | 1 | 0 | +-----------------+----------------+---------------------+--------+----------------------+--------------------------+ 16 rows in set (0.00 sec)
// 获取总的记录数 $sql_total_records = "select count(*) from innodb_table_stats"; $total_records_result = mysql_query($sql_total_records); $total_records = mysql_fetch_row($total_records_result); echo "总的记录数位: ".$total_records[0]."<br>";
// 通过GET方式获得客户端访问的页码
$current_page_number = isset($_GET['page_number'])?$_GET['page_number']:1;
if($current_page_number<1) {
$current_page_number =1;
}
if($current_page_number>$total_pages){
$current_page_number = $total_pages;
}
echo "要访问的页码为:".$current_page_number;
// 获取到了要访问的页面以及页面大小,下面开始分页 $begin_position = ($current_page_number-1)*$page_size; $sql = "select * from innodb_table_stats limit $begin_position,$page_size"; $result = mysql_query($sql);
// 处理结果集
echo "<table border='#CCF solid 1px'><th>Mysql Fixed Assets Table</th>";
echo "<tr><td>DbName</td><td>TableName</td><td>Last_update</td><td>n_Nows</td><td>Clustered_Index_Size</td><td>Sum_od_Other_Index_sizes</td></tr>";
while(($row = mysql_fetch_row($result))){
echo "<tr>";
echo "<td>".$row[0]."</td>";
echo "<td>".$row[1]."</td>";
echo "<td>".$row[2]."</td>";
echo "<td>".$row[3]."</td>";
echo "<td>".$row[4]."</td>";
echo "<td>".$row[5]."</td>";
echo "</tr>";
}
echo "</table>";
// 循环显示总页数
?>
<?php
echo '<a href="SlicePage.php?page_number=1">首页</a> ';
for($i=1;$i<=$total_pages;$i++){
echo '<a href="./SlicePage.php?page_number='.$i.'">第'.$i.'页</a> ';
}
echo '<a href="SlicePage.php?page_number='.($current_page_number-1).'">上一页</a> ';
echo '<a href="SlicePage.php?page_number='.($current_page_number+1).'">下一页</a> ';
echo '<a href="SlicePage.php?page_number='.($total_pages).'">尾页</a> ';
<meta charset="utf-8">
<?php
//解决中文乱码,发现不能奏效,则考虑MySQL客户端乱码情况
header("Content-type=text/html;charset=utf-8");
$host = "localhost";
$username = "root";
$password = "mysql";
$dbname = "mysql";
// 开始获取数据库连接
$conn = mysql_connect($host,$username,$password) or die(mysql_error());
// 手动更改客户端编码
mysql_query("set names utf8");
// 选择使用哪一个数据库
mysql_select_db($dbname);
// 获取总的记录数
$sql_total_records = "select count(*) from innodb_table_stats";
$total_records_result = mysql_query($sql_total_records);
$total_records = mysql_fetch_row($total_records_result);
echo "总的记录数位: ".$total_records[0]."<br>";
// 获得总页数,一般来说页面大小事固定的,所以这里暂且定为一页5个数据
$page_size = 3;
$total_pages = ceil($total_records[0]/$page_size);
echo "总页数为: ".$total_pages;
// 通过GET方式获得客户端访问的页码
$current_page_number = isset($_GET['page_number'])?$_GET['page_number']:1;
if($current_page_number<1) {
$current_page_number =1;
}
if($current_page_number>$total_pages){
$current_page_number = $total_pages;
}
echo "要访问的页码为:".$current_page_number;
// 获取到了要访问的页面以及页面大小,下面开始分页
$begin_position = ($current_page_number-1)*$page_size;
$sql = "select * from innodb_table_stats limit $begin_position,$page_size";
$result = mysql_query($sql);
// 处理结果集
echo "<table border='#CCF solid 1px'><th>Mysql Fixed Assets Table</th>";
echo "<tr><td>DbName</td><td>TableName</td><td>Last_update</td><td>n_Nows</td><td>Clustered_Index_Size</td><td>Sum_od_Other_Index_sizes</td></tr>";
while(($row = mysql_fetch_row($result))){
echo "<tr>";
echo "<td>".$row[0]."</td>";
echo "<td>".$row[1]."</td>";
echo "<td>".$row[2]."</td>";
echo "<td>".$row[3]."</td>";
echo "<td>".$row[4]."</td>";
echo "<td>".$row[5]."</td>";
echo "</tr>";
}
echo "</table>";
// 循环显示总页数
?>
<?php
echo '<a href="SlicePage.php?page_number=1">首页</a> ';
for($i=1;$i<=$total_pages;$i++){
echo '<a href="./SlicePage.php?page_number='.$i.'">第'.$i.'页</a> ';
}
echo '<a href="SlicePage.php?page_number='.($current_page_number-1).'">上一页</a> ';
echo '<a href="SlicePage.php?page_number='.($current_page_number+1).'">下一页</a> ';
echo '<a href="SlicePage.php?page_number='.($total_pages).'">尾页</a> ';
// 释放数据连接资源
mysql_free_result($result);
mysql_close($conn);
?>
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有