Home  >  Article  >  Backend Development  >  How Php+SqlServer implements paging display

How Php+SqlServer implements paging display

WBOY
WBOYOriginal
2016-08-08 09:33:361793browse

Php+SqlServer如何实现分页显示

$id=@mssql_connect("ddy","sa"," ") or die("连接不上");
$db=mssql_select_db("ddy",$id);
$query="select * from lr00 order by lr0012 desc";
$result=mssql_query($query);
if($result):
if($tt==""){
$nopa=0;}
else $nopa=$tt;
$gg=mssql_num_rows($result);
echo $gg;
$k=0;
$i=0;
$dd=mssql_fetch_array($result);
if(!$dd){echo '到底了';}
while($dd&&$nopa<=$gg&&$i<3){
if($nopa>=$gg) $nopa=$gg;
@mssql_data_seek($result,$nopa);
$dd=@mssql_fetch_array($result);
if($dd){$nopa++;$i++;
echo "
";
echo $dd[1]; }
}
endif;
?>


>下一页


以上就介绍了Php+SqlServer如何实现分页显示,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn