Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE » How To » flexible approach
flexible approach [message #581] Tue, 30 January 2007 10:21 Go to next message
interop is currently offline  interop
Messages: 45
Registered: October 2006
Member
I'm trying to use aspects of the "flexible approach" (http://www.tonymarston.net/php-mysql/control-data.html) to store attributes of my equipment. I have an equipment table, an attribute table (eqp_attrib) and a link table (eqp_data). eqp_data.value is a varchar(255) and I'd like to change the type (for display only) of the eqp_data.value based on the attribute type. My problem is when I want to add a new entry to eqp_data I cannot change the type of the value because I do not know the attribute type being entered. Has anyone encounted and solved a problem like this?
thanks
Re: flexible approach [message #582 is a reply to message #581] Wed, 31 January 2007 03:51 Go to previous message
AJM is currently offline  AJM
Messages: 2347
Registered: April 2006
Location: Surrey, UK
Senior Member
In the first place you have misunderstood when to apply the contents of that article. It is used to replace a single record with a large number of fields with a separate record for each field, but all still on the same table.

In the second place the arrows on your diagram are going in the wrong direction, which is confusing. The direction should be from ONE to MANY, primary key to foreign key.

I do no understand what you mean by "change the type of value". Table EQP_DATA has VALUE and EQP_ATTRIB_ID, and EQP_ATTRIB_ID supplies a value for EQP_ATTRIB_TYPE_ID. This means that a value is applied to an attribute, and an attribute has a type. A value is not linked directly with a type.

When you create a record on EQP_DATA you must supply a value for EQP_ATTRIB_ID which in turn supplies a value for EQP_ATTRIB_TYPE_ID. You therefore cannot change to a different EQP_ATTRIB_TYPE_ID without changing EQP_ATTRIB_ID.


Previous Topic: Search when some columns are dropdown lists
Next Topic: Blank screen comes on click of navigation button
Goto Forum:
  


Current Time: Fri Apr 19 00:19:04 EDT 2024

Total time taken to generate the page: 0.07624 seconds