List Viewer Question
2 posts by 2 authors in: Forums > CMS Builder
Last Post: December 16, 2010 (RSS)
By 4cdg - December 16, 2010
I am trying to display only records that have a certain field value. I have a dropdown with 7 choices. I know how to display records for all values. I know how to display records for 1 specific value.
I need to display records for only 2 or more values. Example, all records that are Cars and Trucks and Motorcycles need to display.
I have searched the forum, no luck. I think this should be easy, just a novice at this stuff.
thanks
clay
I need to display records for only 2 or more values. Example, all records that are Cars and Trucks and Motorcycles need to display.
I have searched the forum, no luck. I think this should be easy, just a novice at this stuff.
thanks
clay
Re: [4cdg] List Viewer Question
By Jason - December 16, 2010
Hi Clay,
Try something like this:
In this example we'll only be returning records from the section "vehicles" that have a field "type" with a value of "truck","car", or "motorcycle".
It's important to remember that if you're checking against the value of the field "type" not it's label.
Give this a try and let me know if you run into any problems.
Try something like this:
list($vechicleRecords,$vehicleMetaData)=getRecords(array(
'tableName' => 'vehicles',
'where' => "type='truck' OR type='car' OR type='motorcycle'",
));
In this example we'll only be returning records from the section "vehicles" that have a field "type" with a value of "truck","car", or "motorcycle".
It's important to remember that if you're checking against the value of the field "type" not it's label.
Give this a try and let me know if you run into any problems.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/