I have an row in my table from my database that contains bits, it is type bit with 4 chars long, bit(4). In this field all my value are stored like this:
0001
0010
0100
1111
I have tried to select and obtain the exact representation, with the 0 in front of 1 but without luck. I have tried to select the values from the bit field like this:
SELECT BIN(field+0) FROM `table` WHERE value=0001;
the result is: 1, how can i obtain 0001;
I need this value like so because i want to do bitwise operations in PHP. Thank you in advance.
Use LPAD() in mysql