title: Object of class stdClass could not be converted to int codeigniter
body: <p>I want to convert an integer value if I put <code>intval()</code> error again come</p>
  
  <pre><code>&lt;?php
      $last = $this-&gt;db-&gt;select('pt_id')-&gt;order_by('pt_id',"desc")-&gt;limit(1)-&gt;get('patient_details')-&gt;row();
      //$myvar = (int)($last);
          print_r($last);
      ?&gt;
  </code></pre>