Update Row Value If Another Row is Deleted |
After you delete a row, you can update the other rows where the rank is higher. You just need to know what rang was deleted. Something like this:
Code: UPDATE SOMETABLE SET RANK = RANK + 1 WHERE RANK > ? You can do this in your code, or with a database trigger, or if you use CI4, with a model event (before delete or after delete): https://codeigniter4.github.io/userguide...parameters
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/ |
Messages In This Thread |
Update Row Value If Another Row is Deleted - by GregS - 01-31-2020, 10:24 AM
RE: Update Row Value If Another Row is Deleted - by includebeer - 02-01-2020, 03:00 PM
RE: Update Row Value If Another Row is Deleted - by GregS - 02-02-2020, 09:12 AM
|