0
votes

I have a problem with grocery CRUD and "set_relation_n_n" function: http://www.grocerycrud.com/documentation/options_functions/set_relation_n_n

I want the fields from "This Table", "Relation Table" and "Selection Table". There are any way to do that?. This is my schema (MySQL): my tables

EDITED:

A few things (by the moment):

This table: timeline_events;

Relation table: timeline_events_options;

Selection table: timeline_events_tags;

id_timeline is the foreign key from another table (not showing in the image above), event_id is a field required for the widget I am using now. id_event is the foreign key from timeline_events, id_event_tags is the foreign key from timeline_events_tags.

Thank you very much for your answers :).

1

1 Answers

0
votes

I believe you should repair your tables first. All three tables has primary key named id which could be id_timeline in timeline_events table; id_event in timeline_events_options table and id_tag in timeline_events_tags table. Considering this as your table fields, this should be the function.

$crud->set_relation_n_n('eventtags', 'timeline_events_options', 'timeline_events_tags', 'id_timeline', 'id_tag', 'tags','priority');

I don't guaranty it will work because I didn't test it but you can try this one.