Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The object in question (<code>CI_DB_mysql_result</code>) is missing the <a href="http://www.php.net/manual/en/language.oop5.magic.php#language.oop5.magic.tostring" rel="nofollow"><code>__toString</code> implementation</a> that's why you get the error. </p> <p>However, this can mean that the object can not be usefully converted to string.</p> <p>Instead you should convert the objects data to string first on your own for the purpose of your <code>print</code> operation. I can not say from the code you've posted which use you're looking for specifically, so there is not more I can add to this.</p> <p>Please see <a href="http://codeigniter.com/user_guide/database/results.html" rel="nofollow">Generating Query Results</a> and <a href="http://codeigniter.com/user_guide/database/active_record.html" rel="nofollow">Active Record Class</a>.</p> <p><strong>Edit:</strong> For a quick and dirty string-printing, you can use <code>print_r</code>, however I do not know if this is actually helpful for your case:</p> <pre><code>$result = $this-&gt;db-&gt;get(); print_r($result); </code></pre> <p>That's comparable to the suggestion given to use <code>var_dump</code>. You should say which kind of information you would like to print actually and for this you should know the type of data the database returns. See the documentation of <a href="http://codeigniter.com/user_guide/database/active_record.html#select" rel="nofollow"><code>get()</code><sup><em>Active Record Class</em></sup></a> for some examples how to work with the return values.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload