日期:2011-12-04 浏览次数:20486 次
- <?php
- $conn = mysql_connect('localhost','root','mysql');
- $db = mysql_select_db("wiki");
- $q = mysql_query("select * from wiki_doc");
- $num = mysql_num_rows($q);
- $perpage = 5;
- $totalpage = @ceil($num/$perpage);
- $page =$_GET['page'];
- if(!isset($page)){
- $page = 1;
- }
- //$start = ($page-1)*$perpage;
- $start = ($page-1)*$perpage;
- $qq=mysql_query("select * from wiki_doc limit $start,$perpage");
- $info = array();
- while($result=mysql_fetch_array($qq)){
- $info[] = $result;
- }
- echo "<table>";
- foreach($info as $key){
- echo "<tr><td>$key[did]</td><td> </td><td>$key[title]</td></tr>";
- }
- echo "</table>";
- if($page!=1){?>