Reply to Re: an array to a database, am having hard time , help!!

Your name:

Reply:


Posted by xclarky on 02/05/06 15:04

ENUM is basically the same as SET however it allows NULL values.
Therefore this would be a wrong data type to use considering what you
are storing. Both basically set up a list of acceptable values for the
field.

As you are storing an array, I would advise you to convert it to a
string so you have a list of numbers, separated by a divider; as you
have done.

You can then store that list in your field, VARCHAR or TEXT should be
appropriate depending on the length of the list.

When retrieving the data you can use explode() or array_map() to create
an array of the numbers for whatever purpose you wish. Alternatively
you can use MySQL functions in the WHERE clause for statements if you
are looking to perform a action where a match is found for a specific
value in your list.

Hope that helps you.

[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

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