Home > Backend Development > PHP Tutorial > 求大大们支招啊 如何让sql读出来的数据按数字排列

求大大们支招啊 如何让sql读出来的数据按数字排列

WBOY
Release: 2016-06-23 14:24:33
Original
826 people have browsed it

这个是sql 语句
SELECT * FROM blog WHERE gid='1'
读出来的数据有
5
1
2
3
4

读取到5的时候就错误了 不按顺序了这么才能根据id的顺序来进行排列


回复讨论(解决方案)

SELECT * FROM blog WHERE gid='1'  order by id

查阅roder by 的用法 

source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template