php - how to search two or more database tables using mysql like clause in codeigniter -
this question has answer here:
- how join 3 tables in codeigniter 4 answers
public function dosearch2 ($string){ $this->db->like('printer.features', $string); $this->db->or_like('printer.model', $string); $query = $this->db->get("printer,scanner",12,$this->uri->segment(3)); return $query->result_array(); } i trying perform simple search across 3 tables in 1 database. using codeigniter query builder class. want know how use clause search 2 fields in both tables similar string. example:
searchword= inkjet; database= office; 3 tables printers scanners laptops how search these 3 tables searchword.
you need join 3 tables first or condition.
not provide code because lesson
if learn it. welcome
Comments
Post a Comment