title: search a string with spaces in sql with php
body: <p>I need to search a string in mysql with php. I get an error related to the spaces in the string. I an not fimilar with regex, I am not sure it that is my only choice.
  example:</p>
  
  <pre><code>$ex="This and That";
  
  $sql = 'SELECT
  some_ID
  FROM ' . atable. ' WHERE ' . strings. ' LIKE ' . $ex. ' AND visable=' . '1';
  </code></pre>
  
  <p>after executing I get an error like:</p>
  
  <blockquote>
    <p>"near 'That AND visable=1' at line x"</p>
  </blockquote>
  
  <p>so its probably not picking up the first two words, any suggestions? 
  Thanks in advance.</p>