Jump to content

Numbering :Auto Generate-MYSQL


sueirnaa
 Share

Recommended Posts

how do i set my numbering in ID field to be auto generate?..i ve already set my so that auto increment..but when i delete 1 record...let's say record number 2;it will be appears like this in my table ........................................No | Name | Address | 1 John US3 Mike M'siano 3, suppose to be no. 2. coz the no 2 has been deleted.Help me to solve this problem.

Link to comment
Share on other sites

That's the standard behaviour, and as such isn't a problem unless it's important to you specifically. I don't think there are any neat automatic ways of fixing it.

Link to comment
Share on other sites

It's generally much more desirable to not renumber everything when you do a delete. If you had 10 rows, for example, and deleted row 3, would you want to renumber all of the other rows to close that gap? What if you had other tables that used the same IDs to link to records in this table? Do you want to have to update all of your tables every time you delete a record?

Link to comment
Share on other sites

how do i set my numbering in ID field to be auto generate?..i ve already set my so that auto increment..but when i delete 1 record...let's say record number 2;it will be appears like this in my table ........................................No | Name | Address | 1 John US3 Mike M'siano 3, suppose to be no. 2. coz the no 2 has been deleted.Help me to solve this problem.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...