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

91 Views Asked by At

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 actor's table as the main table, and then filter it with $crud->where()?

thanks

0

There are 0 best solutions below