title: Getting error when I'm trying to hash in SQL
body: <p>I want to compare an string which is in clear text in the database with an string that is hashed with <code>MD5()</code>. I've tried to do something like this:</p>
  
  <pre><code>SELECT member_email, is_validated FROM members
  WHERE CONVERT(VARCHAR(32), HASHBYTES('MD5', 'member_email'), 2) = '".$_GET['vy']."'
  AND is_validated = '0'
  </code></pre>
  
  <p>But I'm getting <code>You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VARCHAR(32), HASHBYTES('MD5', 'member_email'), 2) = ''  AND is_valida' at line 2</code>. If I remove ' in <code>'member_email'</code> so it's <code>HASHBYTES('MD5', member_email)</code> I'll getting the same error message. What's wrong? Do I have to put the MD5 hash in the database to compare it with the same MD5 hash in <code>$_GET['vy']</code>?</p>
  
  <p>Thanks in advance!</p>