• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

想在分页上添首页和尾页

php 搞代码 3年前 (2022-01-24) 36次浏览 已收录 0个评论

想在分页上加首页和尾页

<?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)) ? '' : <strong style="color:transparent">9来源gaodai#ma#com搞@代~码$网</strong>搞gaodaima代码" 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'> 查看</div></td><br />  </tr> ";<br />   $n++;<br />   }<br />   <br />   ?>
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址