Creating Advanced Search Web page

3 posts by 2 authors in: Forums > CMS Builder
Last Post: January 31, 2011   (RSS)

Re: [gversion] Creating Advanced Search Web page

By Jason - January 31, 2011

Hi,

The best way to do this is to use the function getListOptions. This takes in a given table name and field and returns an array or options. The option value is the index and the array value is the option label. Try changing your code to this:

<select name="condition_match">
<option value="">Any Condition</option>

<?php $conditions = getListOptions('listings','condition');?>
<?php foreach($conditions as $value => $label):?>
<option value="<?php echo htmlspecialchars($value); ?>"><?php echo htmlspecialchars($label); ?></option>
<?php endforeach ?>

</select>



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: [Jason] Creating Advanced Search Web page

By gversion - January 31, 2011

Hi Jason,

That's worked perfectly!

Thank you very much for your help.

Greg