tags:

views:

18

answers:

1

Hi there!

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

$quey1="select * FROM tbname ORDER BY 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!

+1  A: 

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.

Johannes Gorset
how it can be regarding gaps anyway?!
Col. Shrapnel
Well. I don't know. The script I have is also counting the number of rows. That could be it. I will try. //EDIT:That was it.
Hugo