Maintain Min amount of records in table and total records

4 posts by 3 authors in: Forums > CMS Builder
Last Post: February 7, 2011   (RSS)

Re: [twocans] Maintain Min amount of records in table and total records

By gkornbluth - February 5, 2011 - edited: February 5, 2011

Hi Kenny,

This short recipe from my CMSB Cookbook http://www.thecmsbcookbook.com might help to get you started.

WANT TO SHOW A RECORD COUNT ON YOUR WEB PAGE

You can use this to see the total number of records displayed:

<?php echo $your_table_nameMetaData['totalRecords']; ?>

There's a few other variables that can be used besides “totalRecords” as well, you can list them all with this code:

<xmp><?php print_r($your_table_nameMetaData); ?></xmp>
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [twocans] Maintain Min amount of records in table and total records

By Jason - February 7, 2011

Hi Kenny,

How would you want this feature to work? What would happen if a user had fewer than the Minimum number of records?

If it's a matter of figuring out how many records you're working with at run time, you could use the php count() function.

For example:

<?php
$recordsReturned = count ($listingsRecords);
?>


You can then test this value to make sure it falls within the range you want.

Would this accomplish what you need?

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/

Re: [twocans] Maintain Min amount of records in table and total records

By Twocans - February 7, 2011

Thank you both very much for your excellent replies.

I will purchase the cookbook next week.

regards

Kenny