You are here: Re: seperator instead of a comma for listed items in DB? « All PHP « IT news, forums, messages
Re: seperator instead of a comma for listed items in DB?

Posted by Gordon Burditt on 04/18/06 00:50

>I'm making a recipe database, and need to have DB fields in mySQL that
>will have lists of values that would get sent to an array to be worked
>on.

If you're putting a list of values in a single field, that represents
a one-to-many relationship, and calls for use of another table.
For example, a table called Ingredients which contains the
ingredient, quantity, and ID of the recipe to which it belongs.

>I anticipate that at times a comma will need to be used in the value
>itself. So, what's a commonly used symbol or something that people tend
>to use as a separator of a list that would then be used in the split()
>function to send the elements into an array?
>
>Nearly every punctuation has a chance of being in the actual data. Any
>suggestions?

Use another table.

Gordon L. Burditt

 

Navigation:

[Reply to this 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

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