|
-
October 10th, 2009, 11:42 AM
#1
auto increment problem.
Hello. I have a SQL code like this:
Code:
CREATE TABLE IF NOT EXISTS `test`(
`id` int(10) NOT NULL AUTO_INCREMENT,
`test2` varchar(15) NOT NULL,
`test3` varchar(15) NOT NULL,
PRIMARY KEY(id)
)
Each time I add a new data it will get id 1 and if I add more it will become id 2. That's correct. But whenever I delete one of them, it doesn't down one down, so if I have added 5 and deleted number 3 and added a new one, that one will become number 6. But there is no id 3, so how can I make it move all the higher numbers one down if a lower number is deleted. Since a list like this is pretty dumb:
1
2
4
5
6
- It should be like this:
1
2
3
4
5
- realchamp.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|