Monday 22 May 2017

How To insert characters as HEX Numbers in MySQL?

You can use UNHEX() function to convert a hexstring with hex pairs to binary and HEX() to do the other way round. Insert Usage
INSERT INTO tbl (col) VALUES (UNHEX('4D2AFF'));
Select Usage
SELECT HEX(col) FROM tbl;

No comments:

Post a Comment

Advertisement

Advertisement