title: Codeigniter Active Record return type
body: <p>I tried to get a <code>umat_id</code> with this SQL query :</p>
  
  <pre><code>SELECT umat_id FROM msumat WHERE nama = $nama
  </code></pre>
  
  <p>I converted this SQL query into CI's Active Record :</p>
  
  <pre><code>$this-&gt;db-&gt;select('umat_id');
  $terdaftar = $this-&gt;db-&gt;get_where('msumat', array('nama' =&gt; $nama));
  </code></pre>
  
  <p>So this query should return a string (example : "John").</p>
  
  <p>But I got an error when I tried to echo it :
   <strong>Object of class CI_DB_mysql_result could not be converted to string</strong></p>
  
  <p>I have tried something like this : <code>echo (string)$terdaftar;</code>, but it's not working.</p>
  
  <p>All I want is to echo "John"</p>
  
  <p><strong>EDIT</strong> 
  Just said I want to insert "John" into a variable. How to do that?</p>
  
  <pre><code>$john = ????
  </code></pre>