I have this function:
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.
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.