You want to add the home page and the last page to the page.

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.