HI, thanks for the response. But above methods gonna create new rows instead of replacing the old values (image IDs) by new values (image IDs) IF values (image IDs) arent same. So, is there any way to avoid deleting any old image IDs that exist in new image IDs
For image fields, each image ID is stored in a single row in the DB. If you don't want to delete old rows, then you can get them all via get_post_meta function and do some check before updating. But I guess it takes more (maybe a lot) of code to check. A better and simpler way to do that is delete all old rows and add new rows.