Re: Pragmatically changing a "Record Number"

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

 



tedd wrote:
At 11:48 AM -0400 9/3/07, brian wrote:

Arrggg. No, I did not say create another auto_increment field -- I said:

Quote
The reason for not wanting to care about the auto_increment id is that it is something that the database uses and really should not be changed. If you want to have a sequential record number, then add that field and alter it as you will, but leave the internal workings of database alone.
Un-quote

Now, I do not know why what I said seemed to mean something different to you, but my guess is that you didn't read it thoroughly.

My bad. I see, now, that what you meant was, "This is how to re-set your EXISTING auto_increment, AND, here's something else you can do." Yes, i was confused about your intention.

As for the "gap" problem, there is no gap problem if you create another field for record number and alter it to your liking (NOTE: I did not say AUTO_INCREMENT). If you add/delete a record, then adjust the "field for record number" accordingly. You don't have to adjust the database's index to handle gaps.

Well, yes, that would work also but is horribly inefficient because the *entire table* must be altered any time a row is deleted.

I don't see the problem here other than misunderstanding what's been said.

Well, not seperating data and presentation would be another problem, IMO. What if the client decides that Roman notation is cooler? You have to ask yourself what this 'counting column' is doing in your database. Let PHP/Python/XSL/whatever take care of numbering the rows.

brian

--
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