首页  >  文章  >  后端开发  >  想在分页上添首页和尾页

想在分页上添首页和尾页

WBOY
WBOY原创
2016-06-13 12:46:26802浏览

想在分页上加首页和尾页

<?php<br />
  extract($_REQUEST);<br />
  $n=0; <br />
  $query=mysql_query("select count(*) as sm from jiaoshi");<br />
  mysql_query("set names 'GB2312'");<br />
  $row=mysql_fetch_array($query);<br />
  $count=$row['sm'];<br />
    if(empty($offset))<br />
              {$offset=0;}<br />
	/*echo  $offset;*/<br />
   $where = (! isset($surplus)) ? '' : " where surplus='$surplus'";<br />
   $query=mysql_query("select * from jiaoshi $where order by id asc limit $offset,$list_num") or die ("fail");<br />
   mysql_query("set names 'GB2312'");<br />
   <br />
   while($row=mysql_fetch_array($query)){<br />
        if(($n%2)!='0'){<br />
 	  echo "<tr bgcolor=#CDE6C7>";}<br />
	  else{<br />
	  echo "<tr bgcolor=#FFFFFF>";<br />
	  }<br />
	  	  <br />
	if($row['surplus']==0)<br />
	     $ss="不可选";<br />
	else $ss="可选"; <br />
     echo"<br />
	<td   height='22' class='STYLE1'> <div align='center'> ".$row['id']." </div></td><br />
	<td   height='22' class='STYLE1'> <div align='center'> ".$row['subject']." </div></td><br />
    <td   height='22' class='STYLE1'> <div align='center'> ".$row['teacher']." </div></td><br />
    <td   height='22' class='STYLE1'> <div align='center'> ".$row['zhicheng']." </div></td><br />
    <td   height='22' class='STYLE1'> <div align='center'> ".$row['number']." </div></td><br />
	<td   height='22' class='STYLE1'> <div align='center'> ".$row['xuehao']." </div></td><br />
	<td   height='22' class='STYLE1'> <div align='center'>".$ss."</div></td><br />
	<td   height='22' class='STYLE1'> <div align='center'> <a href=xiangxiziliao.php?id=".$row['id'].">查看</a></div></td><br />
  </tr> ";<br />
   $n++;<br />
   }<br />
   <br />
   ?>

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn