many to many explanation needed

pie

Member
Hi , I have 3 tables
place
event
places_events

place is joined to event through places_events table, which contains placeid and eventid

Everything is fine if I use a dropdown dbjoin element to add records there (one entry at a time) but
if I use a databasejoin element with checkbox layout and then save (multiple entries), I have "strange" results: it doesn't seem to save the event id and somehow the existing records are merged together in the list view and repeated... I don't understand why, nor with which "logic" it's grouping them together.

How the automatically created "repeat" tables work? When are they created and what is their purpose? Are these related to dbjoin elements?
I assumed I already had everything I needed with only one table (places_events)

I'd like to use checkboxes to update my places_events table, but I am obviously missing something here. :)

My perfect behaviour would be: owner of a place can add events in that place through a list of all the available events, but he should see already checked events if he already added them.
Unchecking the checkbox should remove the entry from places_events on save.
I don't know if it's possible to do this though. Am I dreaming?

thank you
 
Last edited:
Well, like your places_events table, the automatically created 'repeat' tables are many-to-many map tables.

So if on 'places' you added a join to 'events' called 'events', and set it to be a checkbox join (which can have multiple selection, hence many-to-many), we create places_repeat_events, with the two FK's (foreign keys) 'parent_id' (places) and 'events'.

In other words, the functionality of your places_events is already handled by Fabrik, if you use a checkbox join directly from places to events. And yes, unchecking a checkbox wiull remove it from the places_repeat_events map.

-- hugh
 
  • Like
Reactions: pie
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top