Display a list by keyword

3 posts by 2 authors in: Forums > CMS Builder
Last Post: July 13, 2010   (RSS)

By depdesign - July 13, 2010

I'm trying to display a record from a table (table name is "Loan") on a page if it contains a keyword from a pulldown field named "Items". For example: The "Items" pulldown contains the following list options:
> red house
> red car
> blue house
> blue car

On the page I am trying this but it does not display anything:

<?php if (strpos($Loan['Items'], 'red')): ?>
Display this area
<?php endif ?>

The above only works if I enter the full name like this example
<?php if (strpos($Loan['Items'], 'red house')): ?>
Display this area
<?php endif ?>

My objective is to display anything from a pulldown list that contains a keyword "red".

Any suggestions?
Dan Perez

Re: [Jason] Display a list by keyword

By depdesign - July 13, 2010

Exactly what i was looking for. Your good!
Dan Perez