title: MySQL Function and CodeIgniter Active Record
body: <p>CodeIgniter Active Record is easy, well documented and powerful. But when I try to insert MySQL built in functions <code>CONCAT</code>, <code>NOW</code>, <code>GROUP_CONCAT</code>, <code>DATEDIFF</code>, <code>TRIM</code> etc or my custom functions it is giving errors. The following code works fine...</p>
  
  <pre><code>$result = $this-&gt;db-&gt;select('p.first_name, p.last_name, p.mobile_number, p.email_address')-&gt;from('profile p')-&gt;get()-&gt;result();
  </code></pre>
  
  <p>But When I want to contact <code>first_name</code> and <code>last_name</code> and use MySQL <code>CONCAT</code> function like this...</p>
  
  <pre><code>$result = $this-&gt;db-&gt;select('CONCAT(p.first_name, " ", p.last_name) fullname, p.mobile_number, p.email_address')-&gt;from('profile p')-&gt;get()-&gt;result();
  </code></pre>
  
  <p>It is showing database errors</p>
  
  <pre><code>A Database Error Occurred
  
  Error Number: 1064
  
  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 '", `p`.`last_name)` fullname, `p`.`mobile_number`, `p`.`email_address` FROM (`pr' at line 1
  
  SELECT CONCAT(p.first_name, `"` ", `p`.`last_name)` fullname, `p`.`mobile_number`, `p`.`email_address` FROM (`profile` p)
  
  Filename: D:\xampp\htdocs\example\system\database\DB_driver.php
  
  Line Number: 330
  </code></pre>
  
  <p>Is there a any way to insert MySQL Functions inside CodeIgniter Active Record? Hope I am clear. Thanks in advance.</p>