Primary Key's, by nature, are designed to always be uniqiue, which
means that even if you delete row 6, the next row you insert will be
10 because there is no id 10. If you simply need to get the list of
items in a query, in the order they were inserted, I would suggest using
something like: SELECT * FROM table_name ORDER BY id ASC;
Which will select everything from table_name (with no criteria such as a
WHERE clause) and order it by the id in ascending order (ie,
1,2,3,4,etc.). Avid SQL users will be quick to point out that ASC is not
required as ascending is the default pattern in an order by, but I still
like to specify. =) Let me know if you have any other questions.

Adam Voigt
[EMAIL PROTECTED]

On Tue, 2002-06-11 at 08:52, Hawk wrote:
> I'm filling a database with info, and I'm using id as identifiers in
the
> list, the id is auto increment, and I deleted one entry, now I have a
hole
> in the database, is there any way to fix this?
> lets say I have
> 1
> 2
> 3
> 4
> 5
> 6
> And I deleted 6
> Now it looks like
> 1
> 2
> 3
> 4
> 5
> 7
> 8
> 9 and so on
> 
> is there somewhere the "next" number is located ?
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to