Search code examples
phpmysqlsearchexpressionengine

ExpressionEngine Search: Get exact match from channel field


I have two entries/reviews for a location/entry with an id of 13. However, I can not get an exact match so EE returns anything with a 13 ie 134 etc.

I have tried where="exact" with no success.

Example:

{exp:channel:entries channel="reviews" dynamic="no" search:reviewed_business="13" parse="inward"}
<?php $reviews++; ?>
{/exp:channel:entries} 

$reviews should == 2 but returns 24.


Solution

  • Here is a simple solution, Precede the search term with an "=" like so...

    {exp:channel:entries channel="reviews" dynamic="no" search:reviewed_business="=13" parse="inward"}
    <?php $reviews++; ?>
    {/exp:channel:entries}
    

    Expression Engine Documentation

    Enjoy!