Counting Array Items When perPage Present in Query

3 posts by 2 authors in: Forums > CMS Builder
Last Post: June 24, 2013   (RSS)

By In-House-Logic - June 21, 2013

Hi  again,

Am trying to count() the elements returned in an array. However, the query uses the perPage => #, argument. This means that my count() will always be =< the perPage value. 

Short of running another query under a different name without that limit, does anyone know how to get the full count of the array elements? In this sense the perPage item acts more like a limit than I would have expected.

Thanks,

J.

By Jason - June 24, 2013

Hi,

You can get the total number of records that would be returned, regardless of the "perPage" option by using the MetaData array.

For example:

$articleMetaData['totalRecords']

Hope this helps

---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/