Home

Published

- 1 min read

grocery crud order by

img of grocery crud order by

The solution for this is noted below

grocery crud order by

Solution

   function customers_example() {
    $crud = new grocery_CRUD();
 
    $crud->set_table('customers')
        ->set_subject('Customer')
        ->columns('customerName','contactLastName','creditLimit');
 
    $crud->fields('customerName','contactLastName','city','creditLimit');
 
    //To Order Table
    $crud->order_by('creditLimit','desc');
 
    $output = $crud->render();
 
    $this->_example_output($output);
}

Try other methods by searching on the site. That is if this doesn’t work