I have the following data in a MySQL table
"Data Dump" 2 phone_calls 001 2 phone_calls 010 2 phone_calls 100 2 phone_calls 1000 2 phone_calls 10000 2 phone_calls 100000
if I run PHP code to do bitwise Or operation like so
echo bindec('001') | bindec('010') | bindec('100') | bindec('1000') | bindec('10000') | bindec('100000');
I get 63 for output "which is expected"
if I do the Or manually
000001
000010
000100
001000
010000
100000
======
111111
the result = 111111 which is `32 + 16 + 8 + 4 + 2 + 1 = 63`
When I run the following query in MySQL
SELECT user_id, section_name, BIT_OR(permission_type) AS final
FROM permissions
WHERE section_name ='phone_calls' and user_id = 2
GROUP BY user_id, section_name
which is basically running BIT_OR() on "Data Dump" listed above and the output is
2 phone_calls 108543
why MySQL gives me 108543 and PHP gives me 63? How can I get MySQL to give me 63?