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.
精彩评论