想在分页上添首页和尾页

WBOY
发布: 2016-06-13 12:46:26
原创
801 人浏览过

想在分页上加首页和尾页

<?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 />
   ?>
登录后复制

相关标签:
来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板