⚠ In case you've missed it we are migrating to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This forum is read-only and soon will be archived. ⚠

Set relation between 3 tables

set_relation set_relation_n_n

  • Please log in to reply
No replies to this topic

#1 hale.adh



  • Members
  • Pip
  • 1 posts

Posted 17 March 2016 - 10:41 PM

I have the following db setup:


I have the following code:

$crud->set_relation('series_id','series','{series_name} {series_class_id} {series_category_id}');

This gives me a select dropdown with options that look like:
"Series Name - 3 - 2"


What I want is options that look like:
"Series Name - Class Name - Category Name"


Is there a way to:
- Query the Category table for Category name by ID
- Query the Class table for Class name by ID

- Include that data in the set_relation for series_id?


I have a feeling that this will involve writing a custom module.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users