Data printed out is always interpreted as character data when outputted in a browser. If you want the exact HEX or BIN data representation, you will need to convert it either when you SELECT the data using: HEX()
SELECT HEX(mydata) as hexdata FROM mytable ...
And when you output it, it will now be a string of HEX characters. I think there is an equivalent for binary format which would output 0s and 1s but i'm not sure...
If you can't convert the data at the mysql level (there can be tons of reasons) then you can use the PHP equivalent bin2hex:
echo bin2hex($mydata['mybinarydata'];
The docs for bin2hex can be found at: http://www.php.net/bin2hex
Good luck