I'm implementing a bitfield column to my database on my current project. It's 50 bits long but it does not seem to properly insert the bitfield I create in PHP. This is the literal query (I tried submitting it both in PHP and in phpMyAdmin).
INSERT INTO features (title, category_id, bitnum)
VALUES ("a6", "0", b'00000000000000000000000000100000000000000000000000')
But the value which phpMyAdmin and PHP outputs for some reason is this:
00001100110011100000111000001101100011000000111000
Now, if I choose to select the bitnum column using BIN(bitnum) in a SELECT-query it outputs the correct value. But before I proceed with this I need to know if I'm actually doing this right (because I need to check the column against flags later on). It doesn't seem right that the first bitfield I insert, having only one 1 in the middle, becomes a weird mess of 0 and 1s which right now don't make any sense to me.
I wasn't able to find anything on the subject on Google, nor SO. To my understanding the BIT column supports up to 64 bits.
Thanks in advance.