Jump to content

[SOLVED] the posibility of multiple variables or not... ex. Recipe database.


jimdidr

Recommended Posts

How would i go about adding the possibility of haveing 40 recipe ingredients in a database... I just want to make a simple Database where people can just write in recipes for Whatever they feel like. and i'm stuck on the point of how to having upto 40 variables added the easyest, (i want to be able to index the recipes by ingrediense and also search thru them, so I'm guessing 1 blob of ingredience are out.

 

Any ideas?

Link to comment
Share on other sites

You need to read up a bit about database normalization.  It will seriously benefit you in the long run.

Google 'database normalization'

But to answer your question, you should have separate the tables, rather than add columns

 

But even simpler if you "just want to have a place where people can write recipes"... then just make it store a text area... and allow them to edit it?

 

 

You can provide all the recipe info in a textarea

<textarea rows="20" cols="30" name="recipe">
Pancakes

Prep: Turn on stove to high.

Directions:
1) Add 1 cup instant pancake mix to a bowl.
2) Add 3/4 cup water to bowl
3) Mix water and pancakes, leave slightly chunky.(Do not over mix)
</textarea>

.. etc

 

 

That is an alternative, otherwise if you want to do it the complex but 'right' way... You'll need a fair bit of tables, in order to follow normalization standards.  Tables for each: ingredients, measurements, recipe difficulty, submitter, etc etc... depending on how complex you need it.  [not to mention lookup tables!]

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.