title: Querying NON-escaped strings in MySQL
body: <p>The table has company names which are <strong><em>not</em></strong> escaped.<br>
  My qry looks like </p>
  
  <pre><code>$sql = "SELECT id FROM contact_supplier WHERE name = '$addy' LIMIT 1";
  </code></pre>
  
  <p>The problem comes in where the company name values in the table are sometimes things like "<em>Acme Int'l S/L</em>".<br>
  (FYI: values of the $addy match the DB)<br>
  Clearly, the values were not escaped when stored.</p>
  
  <p>How do I find my matches?</p>
  
  <p><br>
  <strong>[EDIT]</strong><br>
  Ahah! <br>
  I think I'm we're on to something.
  The source of the $addy value is a file</p>
  
  <pre><code>$addresses = file('files/addresses.csv');
  </code></pre>
  
  <p>I then do a </p>
  
  <pre><code>foreach ($addresses as $addy) {}
  </code></pre>
  
  <p>Well, when I escape the $addy string, it's escaping the new line chars and including "<em>\r\n</em>" to the end of the comparison string.<br>
  Unless someone suggests a more graceful way, I guess I'll prob strip those with a str_replace().</p>
  
  <p>:)<br>
  <strong>[\EDIT]</strong></p>