Welcome Guest, Not a member yet? Register   Sign In
Call to a member function row() on boolean
#2

I do not see any calls to db->row() in your code, so I suspect the code you're showing is not the trouble spot. That said, the error message "Call to a member function [some_query_builder_method()] on boolean" is an indication that db->get() or db->get_where() has failed and returned FALSE. If those methods succeed they return a CI_DB_result object.

You can, and probably should, always check that you got something usable before proceeding.

PHP Code:
$query $this->db->get("tblContents");
if(
$query)
{
    foreach ($query->result() as $row)
    {
         echo "<br/>";
         echo "Name: ".$row->name;
         echo " Path: ".$row->path;
    }
}
else
{
   //respond to the failed query, i.e. throw an exception or something

Reply


Messages In This Thread
RE: Call to a member function row() on boolean - by dave friend - 10-05-2018, 11:26 AM



Theme © iAndrew 2016 - Forum software by © MyBB