php和mysql关于分页的有关问题
Jun 13, 2016 pm 01:36 PM
php和mysql关于分页的问题
用php提取mysql中的信息,把他分页显示
代码:
'.($message_count-$i)."楼".' | ';'."用户名:".$name.' | ';'.''.$email.' | ';
'.$time.' | ';'.$words.' | ';|
'.' '.' | ';
$pre_page=$page-1;
$next_page=$page+1;
echo $page;
$PATH_INFO=pathinfo("http://localhost:250/myphp编程/留言板的分页显示/留言板分页显示.php");
if($page==1)
{
echo "第一页 上一页"." ";
}
else
{
echo "第一页";
echo " ";
echo "上一页";
}
echo " ";
if($page==$page_count)
{
echo "下一页 最后一页  ";
}
else
{
echo "下一页";
echo " ";
echo "最后一页";
echo $page_count;
}
?>
代码的分页显示部分是错误的,书上的path_info()函数用错了,我也不知道怎么用,“http://localhost:250/myphp编程/留言板的分页显示/留言板分页显示.php”是我的文件路径。请问在“下一页”“最后一页”,“第一页”“前一页”的链接是应该怎么写?
------解决方案--------------------
$page=$_GET['page'] ? $_GET['page'] : 1; //加上这句。

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

What are the differences between Huawei GT3 Pro and GT4?

Fix: Snipping tool not working in Windows 11

Five selected Go language open source projects to take you to explore the technology world

Go language development essentials: 5 popular framework recommendations

How to Fix Can't Connect to App Store Error on iPhone

Implementing distributed task scheduling using Golang's web framework Echo framework

Laravel development: How to implement WebSockets communication using Laravel Echo and Pusher?

Detailed explanation of the role and usage of the echo keyword in PHP
