Advice needed: implementing custom fields in tables
| From: | Denis Gerasimov | Date: | Tue, 12 Dec 2006 14:23:51 +0000 |
| Subject: | Advice needed: implementing custom fields in tables | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-245752@lists.php.net to get a copy of this message | ||
Hello list members,
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)
1st option is not suitable for in my case because of performance issues.
2nd is relatively hard to implement from scratch.
Any ready-to-use libs or implementation ideas would be highly appreciated!
FYI I am using Joomla! CMS and actually I need to create a Joomla! component
that should also support user-defined fields.
Have a great day,
Denis S Gerasimov
Web Developer
Team Force LLC
Web: <http://www.team-force.org/>
www.team-force.org
RU & Int'l: +7 8362-213555
email: denis.gerasimov@team-force.org