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