PHP paging. some code can help you to check it. clicking the page to get the value is invalid.

Source: Internet
Author: User
PHP paging for help. some code can help you to check it. the value obtained by clicking the page is invalid and so on... greatly help & lt ;? Php & nbsp; $ conn = mysql_connect (& quot; localhost & quot;, & quot; root & quot;, & quot; toma123 & quot;) or PHP paging for help, check the code. the retrieved value by clicking the page is invalid, and so on .... great help

$ Conn = mysql_connect ("localhost", "root", "toma123") or die ("connection error ");
Mysql_select_db ("cs", $ conn );
Mysql_query ("set names 'gbk '");
Mysql_query ("set characher set gb2312 ");
Mysql_query ("set names gb2312 ");



$ Tt = $ _ GET ['TT'];



If ($ Submit ){
$ SQL = "select * from ud8 where sessionm = '$ TT '";
Echo $ SQL;

$ Result = mysql_query ($ SQL) or die ("$ SQL ");

$ Sst = mysql_fetch_array ($ result );

$ Num = mysql_num_rows ($ result); // count the number of rows

$ Pages = ceil ($ num/5); // total number of pages

$ Page = $ _ GET ['Page']; // Obtain the page. If no page is set or the page is 0, set $ page to 1;

If ($ page = "")
{
$ Page = 1;

}

$ Start = ($ page-1) * 5;

$ SQL = "select * from ud8 where sessionm like '% $ tt % 'limit". $ start. ",". 5;


$ Query = mysql_query ($ SQL) or die ($ SQL );

?>


While ($ sumpage = mysql_fetch_array ($ query ))
{
$ XX = "";

$ Id = $ sumpage ['id'];

?>















Company name Thumbnail Introduction Operation

"> Delete




}



If ($ num! = 0)
{
If ($ page! = 1)
{

"Homepage ";
} Else
{
"Homepage \ t ";
}
If ($ page> 1)
{
"Previous Page \ t ";
} Else
{
"Previous Page \ t ";
}
If ($ page <$ pages)
{
"Next Page \ t ";
} Else
{
"Next Page \ t ";
}
If ($ page! = $ Pages)
{
"Last Page \ t ";


} Else
{
"Last Page \ t ";
}
} Else
{
"No records currently !! ";
}

}

?>






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.