Как я могу использовать LIKE для столбца родительской таблицы и таблицы JOINed в CodeIgniter?
$search_input = $this->input->get('search_input', true);
if ($search_input != '') {
$this->db->like('block.name', 'building.name', $search_input);
}
$tempdb = clone $this->db;
$total_row = $tempdb->from('block')->count_all_results();
$this->db->limit($perpage, $page);
$this->db->order_by("block.id", "desc");
$this->db->join('building', 'building.id=block.building_name');
$result = $this->db->select('block.id,block.name,building.name as building_name')->get('block')->result_array();
$data = array();
$data['block_data'] = $result;
Подробнее здесь: https://stackoverflow.com/questions/564 ... rom-two-ta
Мобильная версия