Reply to Re: seperator instead of a comma for listed items in DB?

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация