【发布时间】:2018-02-27 08:29:59
【问题描述】:
我是 Codeigniter 的新手,有两个小问题
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();
请帮我解决。
【问题讨论】:
-
你遇到了什么错误?
标签: codeigniter-3