开发者

Order displayed results by id in php

开发者 https://www.devze.com 2023-01-04 07:20 出处:网络
A webpage displays results from a table in a MySQL database and then order\'s them using; $quey1=\"select * FROM tbname ORDER B开发者_StackOverflowY id DESC\";

A webpage displays results from a table in a MySQL database and then order's them using;

$quey1="select * FROM tbname ORDER B开发者_StackOverflowY id DESC";

"id" uses auto_increment. I have deleted some of the id's. <- Is this why the ordering isn't working?

How can I fix this?

Thanks in advance!


MySQL orders results regardless of gaps in an auto-incremented column. Your query is correct, and should order results by id in descending order. It's possible that any post-processing you may be doing with the data is messing with the order it is presented.

0

精彩评论

暂无评论...
验证码 换一张
取 消