Re: Pragmatically changing a "Record Number"

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

 



At 3:17 PM -0400 9/3/07, brian wrote:
tedd wrote:
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.

"horribly inefficient"?

Renumbering anything is pretty quick these days. To me, things that are "horribly inefficient" are also slow. So, I don't agree. If I remember correctly, I can even renumber a 100K item dB auto_increment index in less than one second -- but I wouldn't recommend it. I think that's pretty quick.

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

No one said that what was in the dB had to be presented in any form, but I do have clients who have items in their dBs and want to see a record number as they pursue their records -- it's only natural.

As for maintaining a record number in a dB I don't see any conflict whatsoever in separating data and presentation. After all, what's in your dB should be data and not presentation (however -- I have found exceptions to this in practical situations when dealing with clients -- they like adding <b> tags to their presentation via their CMS).

Presentation is made during presentation, obviously, by using css and proper html and pulling data from your dB to assemble presentation. If the client wants Roman notation, it's a simple process to provide that. There is no "separating data and presentation" in this issue.

Cheers,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

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