Limit display results by database selection
3 posts by 2 authors in: Forums > CMS Builder
Last Post: June 9, 2011 (RSS)
By degreesnorth - June 8, 2011
I am wondering how I limit listing displays based on a parameter in a drop down. For example, I have a list section in one the section editors, and the options within this 'section' (field name) are health, diet, food, lifestyle. On the list page, I only want to show one of the sections at a time... sort of like
'where' => ' section="health" ',
Would this be the correct way to display only the articles which are related to health?
Thanks in advance
'where' => ' section="health" ',
Would this be the correct way to display only the articles which are related to health?
Thanks in advance
Re: [degreesnorth] Limit display results by database selection
By robin - June 8, 2011
Hey,
That looks about right, but you should flip some of those quotes around. Like this:
The where parameter uses a SQL condition, and SQL uses single quotes for values. So single quotes should be on the "inside".
Hope that helps,
Robin
That looks about right, but you should flip some of those quotes around. Like this:
"where" => " section='health'",
The where parameter uses a SQL condition, and SQL uses single quotes for values. So single quotes should be on the "inside".
Hope that helps,
Robin
Robin
Programmer
interactivetools.com
Programmer
interactivetools.com
Re: [robin] Limit display results by database selection
By degreesnorth - June 9, 2011
Perfect, thanks!