RE: [PHP-DB] Inserting data without a reference in the row.
| From: | John W. Holmes | Date: | Mon, 21 Apr 2003 02:20:52 +0000 |
| Subject: | RE: [PHP-DB] Inserting data without a reference in the row. | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-27205@lists.php.net to get a copy of this message | ||
> I'm trying to add a new column in my moviedatabase because I want to
have
> a
> movienumber that doesn't have "holes" between the movies when I delete
a
> movie. So I have to update the new column with increasing numbers. Is
it
> possible to refer to row with a mysqlnumer of any kind?
If the "holes" in the auto_increment column create problems for you,
then you are not using the column for its intended purpose. It is there
to provide a unique identifier for each row, and nothing else. It is not
there to tell you how many rows you have or anything else.
You're going to end up implementing some horrible hack to add/delete
columns and reset numbers instead of designing your program the right
way. Maybe if you stated why the "holes" cause you trouble, someone
could help you re-write your program so they do not matter.
---John W. Holmes...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/