You should try to find a way to avoid making 112 queries, one for each individual piece of content.
If menu is also built from database, you could use simple join to only select menu items that have linking content record available.
If menu is built on PHP side entierly, you could use sql IN statement to turn that 112 queries into 1 - SELECT id FROM content WHERE id IN (1, 2, ......list of checked IDs).