Re: remove from db renumbering
| From: | Jason Morehouse | Date: | Mon, 01 Jul 2002 03:08:25 +0000 |
| Subject: | Re: remove from db renumbering | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-20226@lists.php.net to get a copy of this message | ||
That's the way auto_increment works. You'll have to make the field
an int (no auto_increment) and supply a record id yourself on insert.
On Mon, 01 Jul 2002 08:21:18 +1200, Chris Payne wrote:
> Hi there everyone,
>
> I have my id field auto incrementing (Of course) and I have a utility
> that allows me to remove items from it, the problem is when I remove
> something the items after it keep their IDs leaving a gap in the ID.
> For example, say I have 1-10 in the ID field and I remove number 8, Ill
> have 1-7 and then 9-10, what I need is for 9-10 to go down to 8-9, how
> can I do this? Its really important as I have an ad-rotator system
> which gets the total number of fields from the DB and if there is an
> empty ID it causes there to be an invalid image appear (Of course).
>
> So all I need is to renumber the ID field after a delete I guess, but
> how?
>
> Any help would be extremely grateful :-)
>
> Thanks
>
> Chris
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.372 / Virus Database: 207 - Release Date: 6/20/2002