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

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

 





On Sep 20, 2009, at 3:37 AM, "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!

--
---
Contact info:
Skype: parham-d
MSN: fire_lizard16 at hotmail dot com
GoogleTalk: parham90@xxxxxxxxx
Twitter: PD90
email: parham90 at GMail dot com


The quick answer is you don't. it will cause you far more headaches than it's worth. the id is only for uniqueness and linking should have nothing to do with havin any meaning in the data.

Bastien

Sent from my iPod

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