title: Ignoring special characters in search query
body: <p>I've been wracking my brain trying to find a solution for this for a couple of days.   I'm trying to make a "smart" query that can handle a wide range of  search terms.      The queries run fine until there are special characters involved and I've had some success w/ the REPLACE method on some characters such as commas and dashes.   Other characters such as quotes and ampersands will result in empty queries.</p>
  
  <p>Here's a few examples: </p>
  
  <p>the original name I'm searching for is "French Is Fun, Book 1 - 1 Year Option" and with this query below, I get results returned with these search terms:</p>
  
  <pre><code>1.  "French Is Fun"
  2.  "French Is Fun, book"
  3.  "French Is Fun, book"
  4.  "French Is Fun, Book 1"
  
  
  SELECT * FROM `products` WHERE ( (LOWER(name) LIKE '%french is fun book%' OR
  LOWER(replace(name, '  ','')) LIKE '%french is fun book%' OR
  LOWER(replace(name, ' ','')) LIKE '%french is fun book%' OR
  LOWER(replace(name, '-','')) LIKE '%french is fun book%')
  </code></pre>
  
  <p>However, when the original title has an ampersand in it like such: "Global History &amp; Geography: The Growth of Civilizations - 1 Year Option" - I get an empty query when I try these different search terms:</p>
  
  <pre><code>1.  "Global History &amp; Geography"
  2.  "Global History Geography"
  </code></pre>
  
  <p>I've tried this to no avail</p>
  
  <pre><code>SELECT * FROM `products` WHERE  
  (LOWER(name) LIKE '%global history geograph%' OR  
      LOWER(replace(name, '  ','')) LIKE '%global history geography%' OR  
      LOWER(replace(name, ' ','')) LIKE '%global history geography%' OR 
      LOWER(replace(name, ',','')) LIKE '%global history geography%' OR 
      LOWER(replace(name, '&amp;','')) LIKE '%global history geography%' OR  
      LOWER(replace(name, '-','')) LIKE '%global history geography%');
  </code></pre>
  
  <p>I also tried adding an escape character to the ampersand and it doesn't help:</p>
  
  <pre><code>SELECT * FROM `products` WHERE  
  (LOWER(name) LIKE '%global history geography%' OR  
      LOWER(replace(name, '  ','')) LIKE '%global history geography%' OR  
      LOWER(replace(name, ' ','')) LIKE '%global history geography%' OR 
      LOWER(replace(name, ',','')) LIKE '%global history geography%' OR 
      LOWER(replace(name, '\&amp;','')) LIKE '%global history geography%' OR  
      LOWER(replace(name, '-','')) LIKE '%global history geography%');
  </code></pre>
  
  <p>And commas in the name also return empty results.    As a demonstration, the original name is this:</p>
  
  <p>"Amsco's AP Calculus AB/BC Preparing for the Advanced Placement Examinations - 1 Year Option"</p>
  
  <p>This attempt always returns empty queries:</p>
  
  <pre><code>SELECT * FROM `products` WHERE 
  ( (LOWER(name) LIKE '%amscos ap calculus%' OR
       LOWER(replace(name, ' ','')) LIKE '%amscos ap calculus%' OR
       LOWER(replace(name, '\'','')) LIKE '%amscos ap calculus%' OR
       LOWER(replace(name, ',','')) LIKE '%amscos ap calculus%' OR
       LOWER(replace(name, '-','')) LIKE '%amscos ap calculus%')
      ) AND ( (`products`.`type` = 'Rental' ) );
  </code></pre>
  
  <p>Any ideas?</p>