title: Getting the id of last inserted record
body: <p>I'm trying to get the id of last inserted record in the Db. But i'm getting the error</p>
  
  <pre><code>      Parse error: syntax error, unexpected T_RETURN in Z:\www\CI4\application\models           \report_model.php on line 69
  </code></pre>
  
  <p>my model:</p>
  
  <pre><code>       function getLastInserted() {
  $query ="SELECT $id as maxID from info where $id = LAST_INSERT_ID()"
  
  return $query; //line 69
         }
  </code></pre>
  
  <p>my controller:</p>
  
  <pre><code>            function index()
      {           
  
      $id=$this-&gt;report_model-&gt;getLastInserted();
      $this-&gt;load-&gt;view('u_type1',$id);
      }
  </code></pre>