Total records

4 posts by 2 authors in: Forums > CMS Builder
Last Post: August 31, 2010   (RSS)

Re: [webgfx] Total records

By zip222 - August 31, 2010

<?php echo ($tablenameMetaData['totalRecords']); ?>

replace tablename with your tablename

Re: [zip222] Total records

By zip222 - August 31, 2010 - edited: August 31, 2010

wait, if you're just trying to display a random article, use the Code Generator and select the Random option. It will give you the necessary code. it will look like this:
list($tablenameRecords, $tablenameMetaData) = getRecords(array(
'tableName' => 'tablename',
'limit' => '1',
'orderBy' => 'RAND()',
));

Re: [zip222] Total records

By keith_s - August 31, 2010

Thanks. I had JUST figured that out:

'orderBy' => 'RAND()',

... much appreciated for the quick reply.

You original answer will help me out in the future as well, I am sure.

Thanks again,
Keith D Sellars