function get_department_list($limit, $start)
{
$sql = 'select var_dept_name, var_emp_name from tbl_dept, tbl_emp where tbl_dept.int_hod = tbl_emp.int_id order by var_dept_name limit ' . $start . ', ' . $limit;
$query = $this->db->query($sql);
return $query->result();
}
我想在我的SQL查询中实现它,但我不知道如何设置限制:
public function get_results($search_term)
{
// Use the Active Record class for safer queries.
$this->db->select('*');
$this->db->from('tbl_products');
$this->db->like('name',$search_term);
// Execute the query.
$query = $this->db->get();
// Return the results.
return $query->result_array();
}
答案 0 :(得分:0)