This site had helped me a lot in the past, but now I am lost. Thanks in advance for your guidance.
I have a MySQL table that contains a Binary value, like the example below. I cannot change the table.
CREATE TABLE `test` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`nid` binary(16) NOT NULL,
`test` varchar(45) DEFAULT NULL,
PRIMARY KEY (`id`))
This an example value of nid: ÞFÈ>ZPÎ×jRZ{æ×
(not all showing, but all 16 are there)
Now I want to create a SQL Query to look for the id of the row where this value is true.
SELECT id FROM test WHERE nid = 'ÞFÈ>ZPÎ×jRZ{æ×';
... does not work. Any idea?
SOLUTION Obtaining the nid in HEX format did the trick. It results in DE46C83E5A50CED70E6A525A7BE6D709 and when I use this in the query like this ...
SELECT id FROM test WHERE HEX(nid) = 'DE46C83E5A50CED70E6A525A7BE6D709';
I am getting the right result.
pid
, notnid
. I'm not sure if that's a typo on your part? – Sachiko