title: How to get max(id) of row data MySql
body: <p>I want to get the maximum id of row data. In my table first column is id then firstname and etc.
  this is the sql command I used to get the max(id) of row data.</p>
  
  <pre><code>&lt;?PHP  $maxid=$this-&gt;db-&gt;query("SELECT MAX(id) FROM `emplyee_personal_details`");
                  print_r( $maxid) ;?&gt;
  </code></pre>
  
  <p>but it prints bunch of data as it is a array. But I need only the maximam id of row data for validation before data inserting and updating.</p>
  
  <p>How to get the maxid. I use codeigniter framework.</p>