Код: Выделить всё
$this->db->select('*');
$this->db->group_start();
$this->db->like('title', $keyword);
$this->db->or_like('keyword', $keyword);
$this->db->group_end();
$locations = $this->place_model->search_ids_by_name($location);
Код: Выделить всё
public function search_ids_by_name($q) {
$this->db->select('id');
$this->db->like('name', $q);
$qry = $this->db->get('places');
$results = $qry->result_array();
$place_ids = array();
foreach ($results as $result) {
array_push($place_ids, $result['id']);
}
return $place_ids;
}
Номер ошибки: 1054, Неизвестный столбец «Категория» в «Где»
Имя файла: models/Place_model.php
Похоже, в моей функции Place_model также используется метод Like() и or_like(). Как мне их разделить?
Подробнее здесь: https://stackoverflow.com/questions/387 ... -new-query