Re: Pragmatically changing a "Record Number"

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

 



tedd wrote:
At 10:27 AM +1000 9/3/07, Chris wrote:

tedd wrote:

At 6:14 PM -0400 9/2/07, brian wrote:

tedd wrote:

How is that contrary to what I said?

You are actually changing the id's in the database.

Brian's example is making up an id to display (much like the excel row numbers) rather than actually changing the id in the database.

Please read what I said above, If you do, then you will see that I advised against altering the index and recommend setting up another field for displaying a record sequence.


It seemed to me that what you were suggesting was to either alter the existing id or to create a second auto_increment field. Isn't there already an auto_increment field in the table? I thought that that was what this was all about: an increment that has gaps.

In any case, i can't see how that would help considering that, should any of the rows then be deleted, we're back to the same problem: the auto_increment field will have a gap. That's why the simplest way to deal with this is to increment a counter var in the presentational logic, given that this counter is for presentational purposes only and is unnecessary to relate to any specific row. That's what the existing id column is for (however "out of order" it may be).

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