Mysql 我想通过在codeigniter数据库数据之间的价格范围请找出
我想通过codeigniter中的数据库为数据之间的范围定价Mysql 我想通过在codeigniter数据库数据之间的价格范围请找出,mysql,codeigniter,Mysql,Codeigniter,我想通过codeigniter中的数据库为数据之间的范围定价 问题是在我看来什么是$content它在购物车类中如何加载$content 这是我的控制器文件 public function index() { $this->load->model('sorts'); $data['products'] = $this->sorts->sort_products1(); $data['content'] = 'cart/products'; /
问题是在我看来什么是
$content
它在购物车类中如何加载$content
这是我的控制器文件
public function index()
{
$this->load->model('sorts');
$data['products'] = $this->sorts->sort_products1();
$data['content'] = 'cart/products'; // Select our view file that will display our products
$output_string = $this->load->view('range1', $data);
}
这是我的型号
public function sort_products1()
{
$this->db->select("p_id,p_img,p_name,p_qty,p_price");
$this->db->where("p_price between 0 and 500 ");
$query = $this->db->get('product');
return $query->result_array();
return $row;
}
<div id="content">
<div class="container-fluid">
<div class="row">
<div id="div1">
<?php $this->view($content) ;?>
</div>
</div>
</div>
</div>
这是我的观点
public function sort_products1()
{
$this->db->select("p_id,p_img,p_name,p_qty,p_price");
$this->db->where("p_price between 0 and 500 ");
$query = $this->db->get('product');
return $query->result_array();
return $row;
}
<div id="content">
<div class="container-fluid">
<div class="row">
<div id="div1">
<?php $this->view($content) ;?>
</div>
</div>
</div>
</div>
////在视图中,$content表示控制器:
public function index()
{
$this->load->model('sorts');
$data['products'] = $this->sorts->sort_products1();
$this->load->view('cart/products', $data);
}
猜测一下,但您在这里并没有给出多少信息?至少,这是错误-2返回。只适用于第一个<代码>返回$query->result_array();返回$row代码>不明白你在这里做什么,在视图中调用一个视图?那就是我在问$content是一个购物车视图如何加载它你将在控制器中加载你的购物车视图,而不是视图…@BrianRamsey你是不对的-视图中的这样一个路径
$this->view(view\u name)
正在工作kk但是wr是视图文件如何添加视图文件