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 !! ";
}
}
?>