Posts: 109
Threads: 28
Joined: Feb 2017
Reputation:
0
Hello, is any method to rearrange the ID of a table, like i have a house system and i create a wrong house, i delete him from the database where his id were 1 and if i create a new house it will be 2, how can i make that id to be 1 or whatever number is the succesive of the last id created
And if are much houses, when i remove a house can i rearrange all to have succesive id's?
Posts: 728
Threads: 109
Joined: May 2015
Reputation:
0
you have to use the Auto Increment function
Posts: 408
Threads: 40
Joined: Nov 2014
Reputation:
0
If is AI you can't get the deleted ID back because that will generate some kind of errors in the mysql(actually not, but the next inserted row generate errors if that ID is in use)
You can delete the AI but you need to insert manually the IDs so the IDs will be as you want
Posts: 109
Threads: 28
Joined: Feb 2017
Reputation:
0
I want only to rearange the id's not to insert manually a new ID
Posts: 728
Threads: 109
Joined: May 2015
Reputation:
0
if you delete a house,and for example id 2 will become id 1,you`re gonna have some problems(like a player owning the house id 2,after you delete house id 1 he`ll own the id 3 ( before delete) because it`ll become the new id 2.why whould you do that?
Posts: 109
Threads: 28
Joined: Feb 2017
Reputation:
0
Ok, i solved, i will drop the column id and i will add again and all will be arranged, now i have a problem with /removehouse command, this will not remove the pickup and label from some houses, not from all
Posts: 109
Threads: 28
Joined: Feb 2017
Reputation:
0
I solved and that, thank all for help!