⚠ 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

How can I show the total number of results/rows



edgarvaldes

edgarvaldes
  • profile picture
  • Member

Posted 03 September 2014 - 17:02 PM

I use

 

$this->grocery_crud->where('field IS NOT NULL');

 

So,  I just want to add something like this at the top of the page:

 

"We have X records with that criteria"

 

using an existing method of CodeIgniter or GroceryCrud, instead of using a manual php code to count the rows.

 

Thanks in advance.


Amit Shah

Amit Shah
  • profile picture
  • Member

Posted 04 September 2014 - 03:45 AM

Grocery crud already shows you how many items it are actually available for the given criteria

you can pull the same using javascript from the id  - total_items

That way u can fetch the data without firing any query or so


edgarvaldes

edgarvaldes
  • profile picture
  • Member

Posted 04 September 2014 - 18:13 PM

Hi, Amit

 

Grocery crud already shows you how many items it are actually available for the given criteria

 

Can you elaborate, please? I can't find anyting in the documentation. :unsure: