You mean to say that your menu and sub menu headings are in a table in database and you want to retrieve them and show it? Can you please show us what you have tried upto now? Code ranch is Not a code mill. If you haven't tried anything, please Show some Effort. We are happy to help you.
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand."
--- Martin Fowler