I was so vague on this set-up that I've been searching and reading mysql documentation and can't found something that really explain my problem.
My problem is I have Two Table, table one is 'singlcustomer' then the second table is 'pickup_singlecustomer'.
'singlecustomer' table has an auto-increment id field.
singlecustomer table has this data, with id as auto-increment
|id| |name| |item |
|1 | |John| |Bike |
|2 | |Mike| |Car |
|3 | |Carl| |Scooter|
In pickup_singlecustomer
it has Identitical Fields to avoid problems but the id
is not incremented.
The operation I have is whenever the Item is pickup by the customer I want to transfer it to the pickup_singlecustomer
table and delete the one in singlecustomer
.
I added a feature of 'Restore' back to singlecustomer
but whenever I restore a data lower than the Auto-increment I get an error. Also if I disregard the first column which is id
it returns the data but with the next increment number.
From This singlecustomer
table
|id| |name| |item |
|1 | |John| |Bike |
|2 | |Mike| |Car |
|3 | |Carl| |Scooter|
Lets say I mark Mike as Pickup, and send the row of data to pickup_singlecustomer
then **delete it in singlecustomer
it looks like this
singlecustomer
table
|id| |name| |item |
|1 | |John| |Bike |
|3 | |Carl| |Scooter|
in pickup_singlecustomer
|id| |name| |item |
|2 | |Mike| |Car |
If I Restore Mike
back to singlecustomer
it looks now like this.
|id| |name| |item |
|1 | |John| |Bike |
|3 | |Carl| |Scooter|
|4 | |Mike| |Car |
Is it possible to return it with the same id?
I have read something that you can set a value lower than the id, but I forgot the keyword and can't look it up anymore due to running googlechrome in incognito.
Also is mysqldump capable to do this? The purpose of this restoration of data Is to have flexibility for the User if he accidentally mark a wrong item, so the user might able to undo it.
Hope you can help me guys thank you very much.