I'm having a problem trying to wrap my head around how to query the database to retrieve the foreign keys in my Nav table and then using those to find the id's in the NavItem table. Can someone point me in the right direction or give me some pointers? i'm not even sure if this should be done in the model or the controller!
Thanks in advance
EDIT
My NavItem table looks like this:
id, button1, button2, button3, button4, region. (the buttons are all foreign keys leading to a separate buttons table)