multiselect how to populate data from single table

i have added custom field to lightbox multiselect. now i want to populate data from single table having column id and name.

when user save data i want to add record to database equal to checkbox checked.

example :

total checkbox shown : 4 (‘tea’,‘coffee’,‘breakfast’,‘dinner’)
checked checkbox : 2 (‘tea’,‘coffee’)

so 2 entries should be added to database
one for tea and one for coffee

how to achieve same any suggestion ?

You need to write a custom backend code for such task, default implementation requires separate tables for events, resources and event-to-resources links.

i want to save database retrieving task is complete