0
public function mandarin_2($limit = '', $offset = '')
    {
        $data['aktivisdcm1'] = $this->db->get_where('tb_imam', array('status' => 'Aktivis'))->result_array();

    $data['title'] = 'Absensi Mandarin 2';
    $this->load->view('absensi/mandarin_2', $data);
    $this->load->view('templates/header');
    // $this->load->view('templates/footer');
}

please help .. how do I make an order by my coding? thank you, I really hope the response

Devsi Odedra
  • 5,244
  • 1
  • 23
  • 37
Edwin Nick
  • 39
  • 6

2 Answers2

1

You can check their documentation right here for their ordering results. This is how they do it.

$this->db->order_by('title', 'DESC');
// Produces: ORDER BY `title` DESC

CodeIgniter Documentation Query Builder Class Ordering Results

Carljul
  • 111
  • 1
  • 4
1

I try this to solve:

$data['aktivisdcm1'] = $this->db->order_by("nama", "asc")-> get_where('tb_imam', array('status' => 'Aktivis'))->result_array(); 
Shawn
  • 1,232
  • 1
  • 14
  • 44
Edwin Nick
  • 39
  • 6