title: SQL SHA1 inside WHERE
body: <p>In my program, we store a user's IP address in a record. When we display a list of records to a user, we don't want to give away the other user's IP, so we SHA1 hash it. Then, when the user clicks on a record, it goes to a URL like this:</p>
  
  <pre><code>http://www.example.com/allrecordsbyipaddress.php?ipaddress=SHA1HASHOFTHEIPADDRESS
  </code></pre>
  
  <p>Now, I need to list all the records by the IP address specified in the SHA1 hash. I tried this:</p>
  
  <pre><code>SELECT * FROM records 
  WHERE SHA1(IPADDRESS)="da39a3ee5e6b4b0d3255bfef95601890afd80709"
  </code></pre>
  
  <p>but this does not work. How would I do this?<br>
  Thanks,
  Isaac Waller</p>