Dropdown filtering with "OR" operator

ce cesarvelame 22 Jan, 2021
I have this function:
​
Dropdown filtering with
Dropdown filtering with
​
The problem is the WHERE condition that I use to filter my results.
​
I got a HTTP ERROR 500 in this setup.
​
If I remove the "OR" operator, it works, but I get the wrong query.
​
When I did this query in PHPMyAdmin I got the right result:
​
SELECT * FROM vuvfk_servicos_servicos as servicos LEFT JOIN vuvfk_servicos_setores as setores ON servicos.setor = setores.aid WHERE servicos.setor = 1 OR setores.hierarquia = 1
​
Any suggestion? Thanks.
This topic is locked and no more replies can be posted.