Just load one record in a table ^^

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

By avrom - April 4, 2010

Hi Guys ;))

Have a list viewer called "properties". Just want to create a list viewer to show the "address" field of the "properties" table.

So when I call up the list viewer I just want to load the "address" field instead of all the fields. That can be done via the where clause, right ?

list($propertiesRecords, $propertiesMetaData) = getRecords(array(
'tableName' => 'properties',
'limit' => '10',
'orderBy' => 'address',
));

Cheers ! and thanx

Re: [virgodesign] Just load one record in a table ^^

By Jason - April 5, 2010

Hi,

getRecords loads all of the fields from a table. However, you can control which fields you output. For example:

<?php foreach ($propertiesRecords as $records) : ?>

<?php echo $records['address']; ?>

<?php endforeach ?>


This print out the address field of each record returned.

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: [virgodesign] Just load one record in a table ^^

By Jason - April 5, 2010

Hi,

There isn't a way to limit the fields that are returned by getRecords. But since you control what fields are actually outputted, there really isn't any need to.

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/