<body> <br /> <!--查询表格--> <?php $name=""; $tj=""; //分页条件 if(!empty($_GET["name"])) //多条件查询 { $name = $_GET["name"]; $tj = " where table_name like '%{$name}%'"; } ?> <form> 关键字: <input type="text" name="name" value="<?php echo $name; ?>" /> <input type="submit" value="提交"/> </form> <!--表格部分--> <br /> <table border="1" cellpadding="0" cellspacing="0" width="100%"> <tr> <td>1</td> <td>2</td> <td>3</td> <td>4</td> <td>5</td> <td>6</td> <td>7</td> </tr> <?php include("./DBDA.class.php"); include("./page.class.php"); $db = new DBDA();//因自定义housedb数据库,重新定义数据库 $ss="mysql"; $sqlall = "select count(*) from innodb_index_stats ".$tj;//有条件的SQL语句 $result = $db->query($sqlall,0,$ss); $total = $result[0][0]; $page = new Page($total,5); $sqll = "select * from innodb_index_stats ".$tj.$page->limit;//有条件的分页查询 $attr = $db->query($sqll,0,$ss); foreach($attr as $v) { echo "<tr> <td>$v[0]</td> <td>$v[1]</td> <td>$v[2]</td> <td>$v[3]</td> <td>$v[4]</td> <td>$v[5]</td> <td>$v[6]</td> </tr>"; } ?> </table> <br /> <div style="background-color:#0FF" align="center"><?php echo $page->fpage(); ?></div> </body> </html>