⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Grocery Crud Limit Function



Ankit Agarwal
  • profile picture
  • Member

Posted 26 October 2013 - 11:03 AM

Hi,

I am trying to use limit function of grocery but its not giving expected output.

 

$crud = new grocery_CRUD();
             $crud->set_theme('datatables');
            $crud->set_table('scores');
           
                $crud->limit($limit);
$output = $crud->render();

there are two records and limit is set to 1 but i am getting two records.Please help

           

 


Amit Shah
  • profile picture
  • Member

Posted 28 October 2013 - 09:24 AM

Hi Ankit

 

Will recommend you also set the offset

$crud->limit(1,0) - that should ensure u 1 record. It works for me also :)