title: SQL: SELECT binary value
body: <p>I have:</p>
  
  <pre><code>$token  = sha1(uniqid(mt_rand(), true));
  </code></pre>
  
  <p>Then I'll insert it into the database using <code>unhex('$token')</code>. How do I select this value?</p>
  
  <p>I've tried:</p>
  
  <pre><code>SELECT token FROM `name` WHERE `id` = 1 LIMIT 1
  </code></pre>
  
  <p>If I echo it in it'll show as <code>0b7GÞ÷:‹xcÅ•½JAjdäáæ</code> rather than something like  <code>5dc012f007b7c4db7b9e076138fdd92fa1039530</code></p>
  
  <p>What am I doing wrong?</p>