Re: Question: Correcting MySQL's ID colomn when removing an entry

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

 



On Sun, 20 Sep 2009 12:07:39 +0430
"Parham Doustdar" <parham90@xxxxxxxxx> wrote:

> Hello there,
> I'm guessing that when a row in a MySQL table is removed, the ID
> colomns of the rows which come after that row are not changed. For
> example: 1 2
> 3
> 4
> 
> Now, if I want to remove the third rows, the ID colomn would be
> something like: 1
> 2
> 4
> 
> I was wondering if there was a way to fix it through a query, so I
> wouldn't have to use a for statement in PHP to fix it?
> 
> Thanks!
> 

I'm not sure why you would want to do that--it would make things very
hard to keep track of. Once an ID has been assigned to a set of data,
that ID should not change.

Perhaps if you explained the actual problem you're having, instead of
how you're trying to solve it, it would be easier to offer a possible
solution. There is likely a way to solve it which does not involve
mangling the stored data.


Regards,

Torben

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