Как получить изображения из папки, которая связана с идентификатором элемента?Php

Кемеровские программисты php общаются здесь
Anonymous
Как получить изображения из папки, которая связана с идентификатором элемента?

Сообщение Anonymous »

Основная проблема связана с моделью: я не могу понять, как объединить две таблицы, чтобы отобразить элемент с его изображением, которое хранится в разных местах.
модель

$this->db->select('bs_items.id, bs_items.description, bs_items.title,
bs_items.touch_count,bs_items.price');
$this->db->from('core_images');
$this->db->join('bs_items', 'core_images.img_parent_id =
bs_items.id');
$this->db->order_by('bs_items.touch_count', 'desc');
$this->db->from('bs_items');


Контроллер:

this->load->model('Popular_car');
$this->load->model('Recent_car');
$data['popular_cars']= $this->Popular_car->popular_car();
$data['recent_cars']=$this->Recent_car->get_listing();
$this->load->view('templates/header');
$this->load->view('pages/home', $data);
$this->load->view('pages/home_recent', $data);
$this->load->view('templates/footer');



Подробнее здесь: https://stackoverflow.com/questions/602 ... an-item-id

Вернуться в «Php»