MYSQL > Autoincrement-Problem
#2

Hmm, save the last deleted ID in some variable and just add one to it to figure out next ID. It's just a quick thinking, check this example maybe:

pawn Код:
// When deleting for example ID 5
lastDeletedID = 5;
// Then somewhere else
printf("The next ID will be: %d, want to insert?", lastDeletedID + 1);
Edit:

I think you should add to my code to check if the deleted ID is highest or not.
Reply


Messages In This Thread
MYSQL > Autoincrement-Problem - by Meisternuke - 14.06.2015, 02:14
Re: MYSQL > Autoincrement-Problem - by [KHK]Khalid - 14.06.2015, 02:18
Re: MYSQL > Autoincrement-Problem - by Meisternuke - 14.06.2015, 02:19
Re: MYSQL > Autoincrement-Problem - by [KHK]Khalid - 14.06.2015, 02:21
Re: MYSQL > Autoincrement-Problem - by Emmet_ - 14.06.2015, 02:26
Re: MYSQL > Autoincrement-Problem - by Meisternuke - 14.06.2015, 02:41
Re: MYSQL > Autoincrement-Problem - by Emmet_ - 14.06.2015, 04:43
Re: MYSQL > Autoincrement-Problem - by Konstantinos - 14.06.2015, 10:30

Forum Jump:


Users browsing this thread: 1 Guest(s)