PHP paging for help, there is code to help look at. Click on the page to get the value of invalid online .... Big 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); Number of rows of statistics
$pages =ceil ($num/5); Total pages
$page =$_get[' page '; Get page, if not set or page=0, put $page=1;
if ($page = = "")
{
$page = 1;
}
$start = ($page-1);
$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 image |
Brief introduction |
Operation |
|
|
|
The > Delete |
}
if ($num!=0)
{
if ($page!=1)
{
"Home";
}else
{
"Home \ 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 \ T";
}else
{
"Last \ T";
}
}else
{
"No records at this time!";
}
}
?>