PHP - Reinforce Search with References

0

Good,

I have this Search option, where it looks for the Title and Variable Referrer Category requested by FORM.

foreach($search_exploded as $search_each ) { 

    $x++; 

    if($x == 1) { 
        $wherearr[]= "ads_title LIKE '%$search_each%' AND category_id = '$category' AND ads_active = 1 AND ads_end = 0"; 
    } else {     
        $wherearr[]= "ads_title LIKE '%$search_each%' AND category_id = '$category' AND ads_active = 1 AND ads_end = 0"; 
    }

}

What I want now is to add 1 more field, where the person can also search by product reference.

The goal is, when the person inserts the reference, it will automatically go to the product.

In this way:

 $wherearr[]= "ads_reference LIKE '%$search_each%' AND ads_active = 1 AND ads_end = 0"; 

How can I get the code to search the 3 ways?

    
asked by anonymous 02.09.2018 / 01:49

0 answers