Re: record ID problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ahmed Abdel-Aliem wrote:
> Hi,
> i have a script which reads and edit and delete records from a database
> table.
> the proplem is i nthe ID field.
> when i delete a row the sequence of numbers still the same, i need a
> function which return the IDs in the form of 1 2 3 4 5 6 7 8 9
> instead of  1 3 7 9,
> can anyone help me plz ?

But you *WANT* those ID numbers to be "missing"!

They've been deleted.  Leave them alone.

If you use the ID to relate this table to some other table, you *NEED*
those numbers to be "gone" so that the other table knows the record was
deleted.

This is a perennial question from newbie database users, who think they
want their IDs to always be sequential, with no "holes"

Trust us.

You don't want that.

Now, whereever you *DO* want 1, 2, 4, 5, 6, 7, 8, 9, just figure out a way
to get that there, using something *OTHER* than the ID field.

-- 
Like Music?
http://l-i-e.com/artists.htm

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux