PLEASE ONLY BID IF YOU UNDERSTAND WHAT I’M ASKING FOR.
I’m using 68 Classifieds and the script automatically generates a query when a user performs a search on the site. A sample search generates the following query:
SELECT pID FROM class_products_fields WHERE fID=26 AND sValue LIKE ‘%Bay Ridge|%’ AND sValue LIKE ‘%Bed-Stuy|%’
That query doesn’t return any values because I need an OR statement on the THIRD CONDITION. I need my query to read like this:
SELECT pID FROM class_products_fields WHERE fID=26 AND sValue LIKE ‘%Bay Ridge|%’ OR sValue LIKE ‘%Bed-Stuy|%’
The code that’s generating the SQL is this:
$option=str_replace(‘opt’,”,$objItem);
$option = (int)$option;
$search=”;
foreach($objValue as $key)
{
$search2 = $key.’|’;
$search .= “AND sValue LIKE ‘%”. safeAddSlashes($search2) .”%’ “;
}
This project is to modify the code so that each pass after the first AND will use an OR statement instead of just writing AND statements.
