RE: Mysql Rows

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

 



At 10:56 AM 3/6/2006, tedd wrote:

As such, if you don't renumber, then the only thing left is to use a
timestamp, I guess.
[/snip]

No, if you have gaps you can still step through sequentially, like 14,
15, 18, 19, 20...

It's the gaps that are the problem.

I have no problem understanding why there are gaps in a dB and dealing with them. After all I've been juggling memory and bit-twiddling longer than I want to admit, so I understand "holes" in stuff. But what I am trying to solve is the simple thing of presenting records to a civilian such that there are no gaps in his record keeping.

I don't want to have to explain to my client why his dB has gaps in it. I don't want to listen to him asking why those gaps aren't filled. In fact, I don't want to raise the issue at all if I can get around it.

One way I found to get around this problem was to simply renumber the "id" filed in the table -- but, I received considerable advice against that from this list. I'm still not certain as to why that shouldn't be considered a "good" solution, but the "feelings" of the group are "don't do it".

So, I'm still trying to find a simple way around this problem. Either I renumber the "id" field OR provide an external counter to present to the user. I don't see any other solutions, does anyone?

Thanks.

tedd

Tedd,

Why does he even have to see gaps? Just present the info, unless he wants to see the ID.

If wonders why there are gaps, then just tell him that happens when someone is deleted.

If he wants the gaps "filled" - then keep a table of the "holes" and recycle those numbers when new members are added. But there will still be occasional gaps.

But if you renumber the ID field, you have seamless crap, because the number is absolutely meaningless. Today I'm 2345, tomorrow 2344 because one member's been deleted, next day I'm 2322 because a lot of people were deleted but the day after that 2367 because a lot of people signed up.

If the client wants the number of current people, then SELECT Count(*) ... gets it for you.

Why are we still chasing this thread?

Regards - Miles

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.1.375 / Virus Database: 268.1.2/274 - Release Date: 3/3/2006

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