I have in my database a category defined as TERRENO / ÁREAS that when doing the following SQL query does not return any results from the existing 18.
SELECT * FROM property WHERE 1 = 1 AND CATEGORY IN ('LAND / AREAS')
This query already works:
SELECT * FROM property WHERE 1 = 1 AND CATEGORY IN ('APARTMENT')
Does anyone familiar with SQL know why the first statement does not return a result? Is it a problem with characters?
Update
The IN is because the values obtained come from an array// se $tipo for um array e for maior que 0
if (is_array($tipo) && count($tipo) > 0) {
$where .= " CATEGORIA IN ('".implode("','", $tipo)."') AND ";
} else {
$where .= " CATEGORIA = '{$tipo}' AND ";
}
And it is AAS even, a term coming from a web service whose software is very poorly done and needs to be inserted into the database in this way.