Dependant entries: Does anybody know how to do this?

I’ll try keep this question as simple as possible:

#FRONTEND :

[LIST=1]
[]User selects items (from predefined list): “itemx, itemy”
[
]database is updated.
[*]cycle is repeated.
[/LIST]
#BACKEND

[LIST=1]
[]php enters itemx, itemy into database (single entry).
[
]php should find out what components of itemx, itemy are (stored in another table, with key as itemid)
[*]increment use of componentx, componenty of respective item.
[/LIST]
please do help, i know this is a little confusing, but if you are able to, i’ll be most grateful to you! please do ask if something is not clear.