gilespatrickson Posted December 14, 2009 Share Posted December 14, 2009 I am creating a site where restaurants can list their own menus. My question is this. Each restaurant will have its own menu. They will have several items on their menu. Would it be better create a separate table dynamically for each restaurant or just have one menu table and display menu items by the restaurant id? Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/185154-should-i-use-tables-or-not/ Share on other sites More sharing options...
phpfan101 Posted December 14, 2009 Share Posted December 14, 2009 I recommend giving each a dynamic menu... it will be easier to both read, and spot/fix errors Quote Link to comment https://forums.phpfreaks.com/topic/185154-should-i-use-tables-or-not/#findComment-977393 Share on other sites More sharing options...
calmchess Posted December 15, 2009 Share Posted December 15, 2009 I'd personally break each restraunt into seperate tables for managment purposes.....unless you will be adding new restraunts dynamically then i would probably keep 1 table. Quote Link to comment https://forums.phpfreaks.com/topic/185154-should-i-use-tables-or-not/#findComment-977414 Share on other sites More sharing options...
gilespatrickson Posted December 15, 2009 Author Share Posted December 15, 2009 The restaurants have a table and the menus for each restaurant will need to be listed in another table. My question is whether I should create a table for each restaurant's menu or create one table and list all the restaurants menu items in that table with a restaurant_id to signify which items belong to each restaurant. Quote Link to comment https://forums.phpfreaks.com/topic/185154-should-i-use-tables-or-not/#findComment-977415 Share on other sites More sharing options...
mikesta707 Posted December 15, 2009 Share Posted December 15, 2009 How much information are you taking for the menu? just the dish name? ingredients? price? description? if there is a bit of information, depending on how many menu's you have, 1 table might get a little messy. Then again, multiple tables might be a little overkill. For a relatively small amount of data, I would just use one table with columns for each piece of information about a menu item, and, as you said, a restaurant_id to identify them Quote Link to comment https://forums.phpfreaks.com/topic/185154-should-i-use-tables-or-not/#findComment-977425 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.