Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Displaying multiple menus from multiple restaurants.

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Displaying multiple menus from multiple restaurants.

Postby inoob » Tue Nov 13, 2012 11:12 am

I was wondering how you display menus from different restaurants using an id and how you add multiple restaurant menus into a database. How many tables do I need? For example http://www.website.com/pickyourfood.php?id=1234567. 'id=1234567' fetches information from the mysql database from a table which has the particular restaurants ID using GET, and which is then connected to other tables that have the menu details for that restaurant and display it all into a table. The table would display different category of foods with their subcategories from that particular menu.

A restaurant has a Menu with categories. Those categories have subcategories. if I'm right.

Ex.

[img]Restaurant%20Logo[/img]
Restaurant Name
Address
Phone Number
Postal Code



Beverages
Coke-------------------$1.00 [Click here to Add to order list]
Pepsi-------------------$1.00 [Click here to Add to order list]
Orange Crush-------------------$1.00 [Click here to Add to order list]
Diet Pepsi-------------------$1.00 [Click here to Add to order list]

Sandwiches
Tuna Sandwich------------$3.25 [Click here to Add to order list]
Beef Sandwich------------$3.25 [Click here to Add to order list]
Chicken Sandwich------------$$4.20 [Click here to Add to order list]
Chicken Sandwich------------$$4.20 [Click here to Add to order list]

Hot Drinks
Hot Orange Crush-------------------$1.00 [Click here to Add to order list]
Hot Pepsi-------------------$1.00 [Click here to Add to order list]
Hot Coke-------------------$1.00 [Click here to Add to order list]
Hot Diet Coke-------------------$1.00 [Click here to Add to order list]

Pizza
Pepperoni-------------------$1.00 [Click here to Add to order list]
Vegetarian-------------------$1.00 [Click here to Add to order list]
Cheese-------------------$1.00 [Click here to Add to order list]
Bacon-------------------$1.00 [Click here to Add to order list]

Salads
Chicken Sandwich------------$$4.20 [Click here to Add to order list]
Chicken Sandwich------------$$4.20 [Click here to Add to order list]
Chicken Sandwich------------$$4.20 [Click here to Add to order list]
Chicken Sandwich------------$$4.20 [Click here to Add to order list]

Starters
Chicken Sandwich------------$$4.20 [Click here to Add to order list]
Chicken Sandwich------------$$4.20 [Click here to Add to order list]
Chicken Sandwich------------$$4.20 [Click here to Add to order list]
Chicken Sandwich------------$$4.20 [Click here to Add to order list]


This is so far a complex situation for me as I am still new in PHP. I never tried displaying info from tables that have categories listed with their subcategories. Just wondering how to go around doing this type of work. I heard about foreign keys?
inoob
New php-forum User
New php-forum User
 
Posts: 31
Joined: Tue Nov 06, 2012 12:20 pm

Return to PHP coding => General

Who is online

Users browsing this forum: No registered users and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron