Re: AUTO INCREMENT - MySQL + PHP
| From: | Adv. Systems Design | Date: | Thu, 21 Dec 2000 04:08:01 +0000 |
| Subject: | Re: AUTO INCREMENT - MySQL + PHP | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-5378@lists.php.net to get a copy of this message | ||
I know this may sound bizzarre but in my own situation
(I am not the originator of this post, just a lurker),
users tend to get somewhat disconcerted if you use the
ID# to identify the record in screen output and have
holes in the sequence...
...I have had requests to shore up the "holes" in the
numbers, even to have the ability to rearange them so
that certain records "lie" next to others in listings
(where normal ordering indexes would not put records
together).
I have toyed with creating another column with
"flexible" numbers (leaving original id_num intact,
and only using it internally), but I haven't quite had
the time to figure out a reasonable interface to allow
this changing to go on...presumably it would not
matter to have dupes in the 'new id numbers' and let
certain users change these values for organizational
reasons...
Just a brain fart... 8^)
Luis
--- Paul DuBois <paul@snake.net> wrote:
> At 2:14 PM +1030 12/14/00, Scott Mebberson wrote:
> >Hi Guys,
> >
> >I am using the AUTO INCREMENT attribute on one of
> my cols. I need to know
> >how I can clean this up. For example, just say I
> have rows with the
> >elementID's of 1, 2, 3, 4, 5, 6, 7, 8 and then I
> delete 3, 6 and 7.
> >
> >Is there some command I can call using PHP that
> will re-eval the elementID
> >col to reorder them so it became 1, 2, 3, 4, 5
> >
> >Thanks
> >
> >Scott.
>
> Why do you want to? MySQL doesn't care if the
> values are sequential.
>
> You can drop the column and add it again if you
> really want to do this.
>
> --
> Paul DuBois, paul@snake.net
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> php-db-unsubscribe@lists.php.net
> For additional commands, e-mail:
> php-db-help@lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
>
__________________________________________________
Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.
http://shopping.yahoo.com/