I am currently trying to read from an array, and feed this in to an SQL statement.
My problem is that the array, is encoded so for instance the string customer service is passed to SQL as customer+service, which is not returning any results.
Any ideas how I can amend my code to overcome this?
$count=count($industry);
for ($i=0; $i<$count; $i++) {
// If $industry = all then search all industries
if($industry[$i] == "all"){
if($sql_where != "") {
$sql_where = $sql_where . "AND ";
}
$sql_where = $sql_where . " industry LIKE '%%' ";
// If $industry is not null but doesn't = all then search the specified industries
} elseif(($industry[$i]!="") && ($industry[$i]!="all")){
if($sql_where != "") {
$sql_where = $sql_where . "OR ";
}
$sql_where = $sql_where . " industry = '" . $industry[$i]. "' ";
}
}