|
Posted by Sjoerd on 04/17/06 19:55
news@celticbear.com wrote:
> need to have DB fields in mySQL that
> will have lists of values
Typically, one would use escape characters. For example, | would be
used to seperate two fields. A literal | would be escaped: \|. This
makes it possible to use the seperation character in the data.
Another, probably better option, would be to make a seperate table.
Instead of storing the ingredients seperated by a character like this:
1, Chinese Chicken, chicken|salt|pepper|mushrooms
Think about making a ingredients table and storing it there:
[Recipes]
1, Chinese Chicken
2, Meatloaf
[Ingredients]
1, chicken
1, salt
1, pepper
1, mushrooms
2, meat
2, loaf
This makes it easy to search and it is more logical from a DB point of
view.
[Back to original message]
|