![]() |
Sergey Kornilov admin 5/31/2013 |
You cannot make that happen automatically, databases do not work that way. In general it's a good idea to separate the internals and presentation level. That being said you need to have two fields: ID (primary key, autonumber) and DispalyID. Update MyTable set DisplayID=DisplayID-1 where ID>128 |
P
|
phpcmk author 6/2/2013 |
You cannot make that happen automatically, databases do not work that way. In general it's a good idea to separate the internals and presentation level. That being said you need to have two fields: ID (primary key, autonumber) and DispalyID. DefaultID needs to be set equal to ID when record is created. Then, when you delete a record with ID=128, for instance, in AfterDelete event you can issue the following SQL query: Update MyTable set DisplayID=DisplayID-1 where ID>128
|
![]() |
Sergey Kornilov admin 6/3/2013 |
As I mentioned in my previous post you have to implement AfterDelete event that will renumber DisplayID values after record is deleted. It will not work until you implement this event. |
P
|
phpcmk author 6/3/2013 |
As I mentioned in my previous post you have to implement AfterDelete event that will renumber DisplayID values after record is deleted. It will not work until you implement this event.
|
![]() |
Sergey Kornilov admin 6/4/2013 |
Now you need to make sure:
|