I would like to use a bitwise comparison in my Doctrine2/Symfony2 QueryBuilder. I tried
->andWhere('n.sharingenabled & 1')
And
->andWhere('BIT_AND(n.sharingenabled, 1)')
but they both threw the following error
QueryException: [Syntax Error] line 0, col 327: Error: Expected =, <, <=, <>, >, >=, !=, got '&'
You need to compare the BIT_AND
result to something ... for example :
->andWhere('BIT_AND(n.sharingenabled, 1) > 0')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With