Jump to content


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

relation n-n where clause

  • Please log in to reply
No replies to this topic

#1 majd94

majd94

    Newbie

  • Members
  • Pip
  • 1 posts

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







Also tagged with one or more of these keywords: relation n-n, where clause

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users