Mysqd ID's
#2

Then don't use auto-increment for that field. Although if you want to keep them in order, then you'll need to update tha field and subtract 1 from it.

So, if you have:

1
2
3
4
5
6

and you remove the number 4, it'll go:

1
2
3
5
6

Then you can update those rows from that field that the value is greater than the value you deleted.

So it'll do:

"UPDATE ... field_here = %d WHERE field_here = %d", 5-1, 5

Just an example, of course it'll be a variable.
Reply


Messages In This Thread
Mysqd ID's - by edzis84 - 27.11.2013, 15:40
Re: Mysqd ID's - by Konstantinos - 27.11.2013, 15:43
Re: Mysqd ID's - by -Prodigy- - 27.11.2013, 16:41
Re: Mysqd ID's - by Konstantinos - 27.11.2013, 17:00

Forum Jump:


Users browsing this thread: 1 Guest(s)