you must have the good DB design to fetch the menu from the database. Basic db design can be
menuid,menu name,menu description etc..
Submenu can be
submenuid,submenuname,submenu desc,submenu order(to display at which position),menuid as foreign key.
You also need to consider what else you are going to display with the menu like image,text,hyperlinks or other things.