thank for the response Diego but i do not want (or need) the primary key ID to be sequential, i realize that there will be gaps. What i want to know is if there is any easy way to reorder the records:
lets say i have these records:
1
2
3
4
5
and i delete record "3":
1
2
4
5
when i insert a new record i have this:
1
2
6
4
5
when what i want is this:
1
2
4
5
6
I realize that i can simply write a query with ORDER BY but when browsing the table using any mySQL front-end (like phpMyAdmin) the order is whatever the order the records were inserted. Since mySQL reuses old record positions after a delete, the records will appear out of order in the db. I thought (from the manual) that OPTIMIZE would reorganise the records but it does not seem to do that. Is there another way?