Re: Advice needed: implementing custom fields in tables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, December 12, 2006 8:23 am, Denis Gerasimov wrote:
> I am in a need of implementing custom/used-defined fields mechanism.
> What I
> need is adding new fileds to a db table on-the-fly.
>
> There are 2 possible options I know:
>
> 1.       Add a fixed set of text columns named custom_01, custom_02,
> etc.
>
> 2.       Alter db tables dynamically by adding/dropping a column of
> appropriate type and creating/dropping helper tables if needed (e.g.
> values
> for select lists)

The "usual" answer is to create a single table of user-defined fields,
and put the field_name -> field_data relationship into that.

You have an extra table to JOIN to all your queries, but it works
tolerably well for most usage.

You may want to find out if there is a Joomla approved approach or
something as well, by posting in a Joomla forum.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux