Home > Backend Development > PHP Tutorial > php mysql分页问题

php mysql分页问题

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 20:33:43
Original
1073 people have browsed it

<code>select* from wjyl_content  limit $offset,$Page_size;
上面这段代码可以将表内内容全部查出并能正确显示所有内容。


但是下面这段代码就会出现两个没有内容的空白页  加上where之后为什么会出现这种情况 求大神解答
select * from wjyl_content where content_fenlei='$fenlei' limit $offset,$Page_size     
</code>
Copy after login
Copy after login

回复内容:

<code>select* from wjyl_content  limit $offset,$Page_size;
上面这段代码可以将表内内容全部查出并能正确显示所有内容。


但是下面这段代码就会出现两个没有内容的空白页  加上where之后为什么会出现这种情况 求大神解答
select * from wjyl_content where content_fenlei='$fenlei' limit $offset,$Page_size     
</code>
Copy after login
Copy after login

注意where拼接。

计算内容条数的时候是否加了where条件?可能是页数根据总条数计算出来,但是具体的内容时根据where条件来获取的。

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template