⚠ 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

Unknown Column when using where clause in set relation n-n



majd94

majd94
  • profile picture
  • Member

Posted 04 July 2019 - 09:38 AM

hey guys,

 

when I use set relation n-n with where clause like this

 

$crud->set_relation_n_n('actors', 'film_actor', 'actor', 'film_id', 'actor_id', 'fullname', null, $this->db->like('actor.actor_name','Katja' , 'both');

 

this is not working (Unknown column 'actor.actor_name' in 'where clause') but when I put in the where clause column from the first table it would work. like this $crud->set_relation_n_n('actors', 'film_actor', 'actor', 'film_id', 'actor_id', 'fullname', null, $this->db->like('film.film_name','taken' , 'both');

 
So I cannot access the fields from the selected table!!

I need to search the name of the actors, Could someone please help

Is there a shorter way as using the actors table as main table, and then filter it with $crud->where()?

 

thanks