title: CodeIgniter like query with single quote in search string
body: <p>I have been working on this for like more than 4 hours. I have select query using active record I am doing: $this->db->like ('items.name',$search);
  everything works fine but whenever there is single quote (') in the $search string it gives this error:</p>
  
  <blockquote>
    <p>You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's%' OR <code>default_items</code>.<code>short</code> LIKE 'faith\'s%' LIMIT 5' at line 5</p>
  </blockquote>
  
  <p>I have just checked now that it is adding double back slashes <code>\\</code> instead of single in my active record for LIKE query. I tried in MySQL bt removing one slash and it is working.</p>
  
  <p>My code:</p>
  
  <pre><code>$q = "faith's";
  $query = $this-&gt;db-&gt;select('items_categories.slug as category_slug, items_categories.name as cat_name, items.name, items.price_value, items.cover_photo, items.slug');
  $query-&gt;select('default_items.short as short',false);
  $query-&gt;select('date(default_items.date_created) as date_created',false);
  $query-&gt;join('items_categories','items_categories.id=items.root_id','inner');
  $query-&gt;join('users','items.company_id=users.id','inner');
  $query-&gt;like('items.name',$q);
  $query-&gt;or_like('items.short',$q);
  $query-&gt;limit(5);
  $result =  $query-&gt;get($this-&gt;_table);
  $both_prod_results = $result-&gt;result();
  </code></pre>
  
  <p>I am using pyrocms 2.x.</p>