Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Relationship problems

Featured Replies

Hi There. I have been trying to figure out a solution for this for a day now and thought it would be best to ask.

My database contains a table of plant machinery models e.g. JCB JS130 Excavator

I have a separate table containing all of the "machine makes" e.g. JCB, Caterpillar, Takeuchi

I also have a separate table containing all of the "machine types" e.g. Excavator, Dump Truck, Telehandler

Every record in my "models" table has a reference to a "machine make" ID and a "machine type" ID. These tables are related and its all simple enough.

I now have a table with one record in it, an item. This 'one' record needs to be related to 'many' models.

I have 3 fields in my "item table", a machine make ID, a machine type ID and a model ID.

I have created a second occurrence of the makes table and related my "items" the "makes" through an ID. I have also created a second occurrence of the models table. The models 2 table is related to the machine makes 2 table.

In a nutshell, 'one' item in the items table is related to many models in the models 2 table via a relationship with the machine makes 2 table.

How to I now create this relationship based on the machine type as well?

'one' item in the items table is related to many models in the models 2 table

Are you sure about this? How can an item (presumably a piece a machinery) be of more than one model?

  • Author

Hi There,

We sell glass panels for many machines.

I have a table of models, all related to a manufacturer and a machine type. Every model as a field called CabID.

The Cab ID of every model is related to a table that contains CabID's and ItemID's (Glass panels). The ItemID is related to a table of unique glass items. One Item can be related to many models.

I am now setting up a layout where the user can create a new item and then link that item to multiple models. I have set up a separate table for a new item and wish to link this one item to multiple models. Once the user decides to save this item, I was going to use a script to commit the "temporary new item" to the main items table.

There's probably a far easier way to accomplish this.

At the moment I'm not sure what it is you want to accomplish. Is it defining a new item and at the same time connect it to a number of models?

We sell glass panels for many machines.

...

One Item can be related to many models.

OK, I see. Depending on what you want to do in the next steps, you can either:

• use a checkbox field to select the models compatible with an item;

or:

• use a join table to record each item-model compatibility.

The second option is the more orthodox one, and you will need it if you ever want to produce a report of all compatibilities, e.g. in the form of:

Item ABC

• Model 123

• Model 456

• Model 789

Item DEF

• Model 234

• Model 456

• Model 567

...

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.