Try to select use \"where\" clause in a mysql statement: e.g. Table: X with a ID column which is BINARY data type. Then save in a variable in php
$aid = $row
Answering my own question.
Just figured out:
$where = "where HEX(ID) = 'bin2hex($aid)'"; $query = "SELECT * FROM X ".$where;
Does anyone know better solution?