title: MySQL Like search special chars escape
body: <p>yet another MySQL <code>LIKE</code> search which doesn't return anything</p>
  
  <p>I have contents in my MySQL DB which hold "\'"</p>
  
  <p>However I cannot find them as my query returns either nothing or too many items depending on how i format the like parameter.</p>
  
  <p>This doesn' reurns anything:</p>
  
  <pre><code>SELECT element 
  FROM `elements` 
  WHERE body LIKE '%\\\'%' 
  LIMIT 5
  </code></pre>
  
  <p>This return almost all items because many item hold the single quote char</p>
  
  <pre><code>SELECT element 
  FROM `elements` 
  WHERE body LIKE '%\'%' 
  LIMIT 5
  </code></pre>
  
  <p>This doesn't work:</p>
  
  <pre><code>SELECT element_id 
  FROM `element_body` 
  WHERE element_body LIKE '%|\|'%' ESCAPE'|' 
  LIMIT 5
  </code></pre>