1: Как передать для просмотра два массива данных таблицы?
Код: Выделить всё
$data['customers'] = $this->customer_model->get_all_customers();
// $products['product'] = $this->customer_model->get_all_categories();
// $this->load->view("customer_view", $data);
$product['cats'] = $this->customer_model->get_all_categories();
$this->loadViews("customer_view", $this->global, $data, $product);
2: Я объединяю две таблицы, чтобы получить данные двух таблиц, но получаю данные только одной таблицы?
Код: Выделить всё
public function get_all_categories()
{
// Get Data from Two tables
$this->db->select('*');
$this->db->from('category');
$this->db->join('customers', 'customers.categoryID=category.categoryID', 'Inner');
$query = $this->db->get();
// ...
}
Подробнее здесь: https://stackoverflow.com/questions/490 ... odeigniter
Мобильная версия