Record Count

8 posts by 3 authors in: Forums > CMS Builder
Last Post: December 27, 2008   (RSS)

Re: [rcrofoot] Record Count

By Dave - February 20, 2008

Thanks for posting that! Helpful for anyone else who wants to do the same.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Record Count

It's not working with new versions of CMS Builder.

How can I show total records listed in List Page?

Thank you, Juan.

Re: [jposwald] Record Count

By Dave - November 25, 2008

It should still work. What's it showing for you?

Note that the variable might be different in your viewer file, not $listDetails but something else.
Dave Edis - Senior Developer
interactivetools.com

Re: [jposwald] Record Count

By Dave - December 3, 2008

Hi Juan,

You need to make sure the variable names are the same as the ones used in your viewer page.

Try $featured_propertiesMetaData instead of $listDetails

Let me know if that works for you.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Record Count

Yes Dave!!! You rock, thank you!

Re: [Dave] Record Count

Hi Dave-

Back to the record count question from earlier this year...I need to get the total number of records returned from a CMS query...

As a test, when I tried: <xmp><?php print_r($certificationsRecords); ?></xmp>[/#ff0000], I got a printout of every field and its data for every record in every table...[/#000000]('[/#ff0000]certifications' is my table name)...[/#ff0000]

When I tried: <?php echo $certificationsRecords['totalRecords']; ?>[/#ff0000],[/#ff0000] I got this error: Notice: Undefined index: totalRecords in /var/www/vhosts/ebscerts.com/httpdocs/show_product_list_test.php on line 43[/#ff0000]

Short of putting a counter in one of the foreach loops, is there a way to just retrieve the total number of records returned from a CMS query???

Thanks, and hope you and your family had a wonderful Christmas!

Rick

Re: [rcrofoot] Record Count

By Dave - December 27, 2008

Hi Rick,

Do you want the total records shown on the page (eg: 10) or the total records matched (could be much higher such as 43).

There should be a second variable returned by getRecords() that has info such as that. Try this:
<?php echo $certificationsMetaData['totalRecords']; ?>

Or have a look through the values available using this debug code and use one of them:
<xmp><?php print_r($certificationsMetaData); ?></xmp>

Hope that helps! Let me know how it goes.
Dave Edis - Senior Developer
interactivetools.com