⚠ In case you've missed it, we have migrated 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 is an archived forum. ⚠

  •     

profile picture

Set relation between 3 tables



hale.adh

hale.adh
  • profile picture
  • Member

Posted 17 March 2016 - 22:41 PM

I have the following db setup:
[attachment=1090:Untitled-3.png]

 

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.