Home  >  Article  >  Backend Development  >  两个循环体先后输出并分页

两个循环体先后输出并分页

WBOY
WBOYOriginal
2016-06-23 14:06:01967browse

1、根据a字段的 条件循环输出以下内容:
内容1
内容2
内容3
.......
2、根据a字段的 另一条件循环输出其他内容:
其他内容1
其他内容2
其他内容3
.......
以上1和2的内容 连起来分页显示
我要的效果是分页(循环输出1的内容后才循环输出2的内容)
分页是可以的
问题:
每页设置的显示 数目正确,但是每页显示的内容是1和2的内容


回复讨论(解决方案)

你的sql如何写的,用union all 试试。

union all 不能用
用ORDER BY解决了

Statement:
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