I want to add the home page and the last page & lt ;? Php & nbsp; extract ($ _ REQUEST); & nbsp; $ n = 0; & nbsp; $ query = mysql_query ("select & nbsp; count (*) & nbsp; as & nbsp; add the home page and the last page to the page
Extract ($ _ REQUEST );
$ N = 0;
$ Query = mysql_query ("select count (*) as sm from jiaoshi ");
Mysql_query ("set names 'gb2312 '");
$ Row = mysql_fetch_array ($ query );
$ Count = $ row ['SM '];
If (empty ($ offset ))
{$ Offset = 0 ;}
/* Echo $ offset ;*/
$ Where = (! Isset ($ surplus ))? '':" Where surplus = '$ surplus '";
$ Query = mysql_query ("select * from jiaoshi $ where order by id asc limit $ offset, $ list_num") or die ("fail ");
Mysql_query ("set names 'gb2312 '");
While ($ row = mysql_fetch_array ($ query )){
If ($ n % 2 )! = '0 '){
Echo"
";}
Else {
Echo"
";
}
If ($ row ['Surplus '] = 0)
$ Ss = "not available ";
Else $ ss = "optional ";
Echo"
". $ Row ['id']."
". $ Row ['subobject']."
". $ Row ['teacher']."
". $ Row ['zhicheng']."
". $ Row ['Number']."
". $ Row ['xuehao']."
". $ Ss ."
View
";
$ N ++;
}
?>
Share:
------ Solution --------------------
Print" Homepage Previous Page";}
Print (" Next page Last page");
Actually, the two print statements are written differently ...... Alas, there is a lot of room for improvement
------ Solution --------------------
$ Pageno = floor ($ offset/$ list_num) + 1); // change it to this pattern.