title: PHP codeIgniter query is case sensitive, want to make it insensitive
body: <p>i know only using LOWER and strlower can fix the problem. but problem i am facing is of syntax as i am using datatables library and they have not set it for insensitive so i need to do little update.</p>
  
  <p>last time it worked for me with </p>
  
  <pre><code>like('LOWER(' .$field. ')', strtolower($value));
  </code></pre>
  
  <p>but now the main query is</p>
  
  <pre><code>$sWhere .= $this-&gt;select[$mColArray[$i]] . " LIKE '%" . $sSearch . "%' OR ";
  </code></pre>
  
  <p>so i tried like this</p>
  
  <pre><code>$sWhere .= $this-&gt;select[."LOWER(".$mColArray[$i].")".] . " LIKE '%" . strtolower($sSearch) . "%' OR ";
  </code></pre>
  
  <p>but i am not good with this notations, please can anyone help me out, cuz i get error with this..</p>
  
  <p>This line is from the Ignited-dataTables Library from below function.</p>
  
  <pre><code> protected function get_filtering()
      {
          if($this-&gt;check_mDataprop())
              $mColArray = $this-&gt;get_mDataprop();
          elseif($this-&gt;ci-&gt;input-&gt;post(mysql_real_escape_string('sColumns'))){
              $mColArray = explode(',', $this-&gt;ci-&gt;input-&gt;post('sColumns'));
              $mColArray = array_filter($mColArray);
              if(empty($mColArray)){
                  $mColArray = $this-&gt;columns;
              }
          }
          else
              $mColArray = $this-&gt;columns;
  
          $sWhere = '';
          $sSearch = mysql_real_escape_string($this-&gt;ci-&gt;input-&gt;post('sSearch'));
          $mColArray = array_values(array_diff($mColArray, $this-&gt;unset_columns));
          $columns = array_values(array_diff($this-&gt;columns, $this-&gt;unset_columns));
  
          if($sSearch != '')
              for($i = 0; $i &lt; count($mColArray); $i++)
                  if($this-&gt;ci-&gt;input-&gt;post('bSearchable_' . $i) == 'true' &amp;&amp; in_array($mColArray[$i], $columns))
                      $sWhere .= $this-&gt;select[$mColArray[$i]] . " LIKE '%" . $sSearch . "%' OR ";
  
          $sWhere = substr_replace($sWhere, '', -3);
  
          if($sWhere != '')
              $this-&gt;ci-&gt;db-&gt;where('(' . $sWhere . ')');
  
          for($i = 0; $i &lt; intval($this-&gt;ci-&gt;input-&gt;post('iColumns')); $i++)
          {
              if(isset($_POST['sSearch_' . $i]) &amp;&amp; $this-&gt;ci-&gt;input-&gt;post('sSearch_' . $i) != '' &amp;&amp; in_array($mColArray[$i], $columns))
              {
                  $miSearch = explode(',', $this-&gt;ci-&gt;input-&gt;post('sSearch_' . $i));
  
                  foreach($miSearch as $val)
                  {
                      if(preg_match("/(&lt;=|&gt;=|=|&lt;|&gt;)(\s*)(.+)/i", trim($val), $matches))
                          $this-&gt;ci-&gt;db-&gt;where($this-&gt;select[$mColArray[$i]].' '.$matches[1], $matches[3]);
                      else
                          $this-&gt;ci-&gt;db-&gt;where($this-&gt;select[$mColArray[$i]].' LIKE', '%'.$val.'%');
                  }
              }
          }
  
          foreach($this-&gt;filter as $val)
              $this-&gt;ci-&gt;db-&gt;where($val[0], $val[1], $val[2]);
      }
  </code></pre>