Displaying multiple records that have same list field value

3 posts by 3 authors in: Forums > CMS Builder
Last Post: April 20, 2010   (RSS)

Re: [depdesign] Displaying multiple records that have same list field value

By gkornbluth - April 20, 2010

Hi depDesign,

I found this and it might help.

To show only record from a specific region you can use a MySQL Where query like this: region = "north west"

You can either enter that in the code generator (at the bottom under "Filter Results") or in the viewer code like this:

Code

list($records, $recordMetaData) = getRecords(array(
'tableName' => 'bios',
'perPage' => 5,
'where' => 'region = "north west"',
));


The perPage code is optional of course.

Hope it works.

Best,

Jerry Kornbluth
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: [depdesign] Displaying multiple records that have same list field value

By Jason - April 20, 2010

Hi,

If there is any other kind of search happening on the page, that may be causing the problem. Try this:
list($mediaRecords, $mediaMetaData) = getRecords(array(
'tableName' => 'media',
'allowSearch' => 0,
'where' => "entertainment = \"Music\"",
));


If this doesn't work, replace the 'allowSearch' line with this:

Give that a try and let me know if it works.
'debugSql'=>1,

Then run the script and post what it's outputting.

Give that a try and let me know if it works.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

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