title: base64 decode a mysql column before performing a WHERE
body: <p>Basically - its a long story - but I have a field in a database that is encoded as a base64 string.</p>
  
  <p>EG: this is stored in the database:</p>
  
  <pre><code>YToyOntzOjIwOiJUeXBlX29mX29yZ2FuaXNhdGlvbiI7czoyMDoiTWVtYmVyIG9mIFBhcmxpYW1lbnQiO3M6ODoiUG9zdGNvZGUiO3M6NzoiUEUxIDFKQSI7fQ==
  </code></pre>
  
  <p>Which equals this:</p>
  
  <pre><code>a:2:{s:20:"Type_of_organisation";s:20:"Member of Parliament";s:8:"Postcode";s:7:"#postcode#";}
  </code></pre>
  
  <p>What I want to be able to do is select where this string <code>LIKE '%Member of Parliament%'</code>. Is there any way to base64 decode a mysql column before performing a <code>WHERE</code>?</p>
  
  <p>eg: <code>SELECT * FROM table WHERE base64_decode(column) LIKE '%Member of Parliament%'</code></p>
  
  <p>Thanks</p>