I'm creating a website where people can browse through recipes and save any recipes that they like to their account.
At the moment, I'm constructing the database for it.
I have a table called recipes that has 5 fields:
* recipe_id
* recipe_name
* recipe_ingredients
* recipe_prep
* recipe_keywords
My question centers around the ingredients field. If I allow that single field to contain all the ingredients of a given recipe
(say, for example:
1 whole banana
2 cups strawberries
1/2 pint blueberries )
how can I then use PHP to display the list of ingredient on the page? Won't it just be a jumble of text (that looks something like:
1 whole banana 2 cups strawberries 1/2 pint blueberries
) rather than the orderly, line-by-line list I had intend? *IS* there a way to store the entire list of ingredients in a single field and still be able to break the list up so that I can control how it's output on the webpage?
2006-10-31
00:13:38
·
3 answers
·
asked by
Anonymous
in
Computers & Internet
➔ Programming & Design
Several people have suggested that use a separate ingredients table and inner join them, but I would really prefer to keep the recipes all together, in one place, if I can.
I don't have any experience with joins, and, although I can certainly learn them if I need to, I have so much on my plate with trying to learn PHP and mySQL that I'd like to just keep it as simple as possible.
(Of course, a separate table connected with joins might be the easiest way, in which case, I guess I'd better just suck it up and start studying... :-) )
2006-10-31
00:16:38 ·
update #1