Laker64
09-13-2003, 03:07 PM
Ok, I'm creating a customer database.
Basically, when I created it, this is the way I did it.
$query="ID int(10)
NOT NULL
auto_increment
PRIMARY KEY,
Name varchar(50)";
Right, so I have a database that looks like this:
-----------
ID| Name |
-----------
1 | Name1 |
2 | Name2 |
3 | Name3 |
4 | Name4 |
5 | Name5 |
-----------
Let's say Name2 decides cancel his business. When I delete that row (through phpMyAdmin), I get this:
-----------
ID| Name |
-----------
1 | Name1 |
3 | Name3 |
4 | Name4 |
5 | Name5 |
-----------
However, that's not very helpful. What I really want is this:
-----------
ID| Name |
-----------
1 | Name1 |
2 | Name3 |
3 | Name4 |
4 | Name5 |
-----------
Now, did I screw up when I created my database this way? Or am I screwing up when I delete things? Any ideas on how to make the ID maintain it's order? Thanks.
Basically, when I created it, this is the way I did it.
$query="ID int(10)
NOT NULL
auto_increment
PRIMARY KEY,
Name varchar(50)";
Right, so I have a database that looks like this:
-----------
ID| Name |
-----------
1 | Name1 |
2 | Name2 |
3 | Name3 |
4 | Name4 |
5 | Name5 |
-----------
Let's say Name2 decides cancel his business. When I delete that row (through phpMyAdmin), I get this:
-----------
ID| Name |
-----------
1 | Name1 |
3 | Name3 |
4 | Name4 |
5 | Name5 |
-----------
However, that's not very helpful. What I really want is this:
-----------
ID| Name |
-----------
1 | Name1 |
2 | Name3 |
3 | Name4 |
4 | Name5 |
-----------
Now, did I screw up when I created my database this way? Or am I screwing up when I delete things? Any ideas on how to make the ID maintain it's order? Thanks.