$termos = (explode('/', implode('/', $_GET['tipo'])));
print_r($termos);
Array
(
[0] => CASA
[1] => CASA EM CONDOMINIO
[2] => COBERTURA
)
I'm having a syntax error in this SQL that makes loops to add as many terms as needed that are captured within array
above:
$sql = array('0');
foreach($termos as $termo){
$sql[] = 'CATEGORIA LIKE %'.$termo.'%';
}
$sql = 'SELECT * FROM imovel WHERE ' .implode(' OR ', $sql);
Syntax error or access violation: 1064
I can not figure out what the syntax error was.