Buy Now
Sign in

Dropdown filtering with "OR" operator

cesarvelame , January 22 2021, 14:58
C
cesarvelame 57
January 22 2021, 14:58 #395734
I have this function:
1.png
2.png
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.
C
cesarvelame 57
January 25 2021, 16:59 #395749
Solved.
solved.png
Attachments
solved.png
solved.png
(46.93 KiB)
113 Downloads/Views