RE: [PHP] Adjusting Indexed Field After Deleting Entry
| From: | John W. Holmes | Date: | Mon, 27 Jan 2003 13:14:18 +0000 |
| Subject: | RE: [PHP] Adjusting Indexed Field After Deleting Entry | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-133236@lists.php.net to get a copy of this message | ||
> > I originally had a link #1, #2, and #3. I obviously deleted them.
> > I was wondering if there is a way to use PHP/MySQL to get the
indexed
> numbers to re-assign so that the first link
> you see is always #1 the second link you see is always #2 and so on?
Keep your own count variable when you output your links, don't rely on
the auto_increment column in your database. The auto_increment number is
only there as a unique identifier for each row, not to keep count for
you. If you have problems with gaps in your auto_increment column then
the script is not written correctly.
---John W. Holmes...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/