phpjoincodeigniter-3sql-likequery-builder

Codeigniter Query Builder join table with LIKE condition instead of where?


I can't find any answer in the documentation, I'm trying to achieve this:

$this-db->join("table", "column LIKE %string%");

But it's not working.


Solution

  • $this->db->join('table', 'table.a = table2.b');
    
    $this->db->like('field_name_in_table','value_to_be_compared');
    

    try this. Note: Here table2 is base table.