Welcome Guest, Not a member yet? Register   Sign In
Struckle with my model and the builder - "Call to a member function get() on null"
#4

Try this to see if your getting ant data back from the database.

PHP Code:
public function getAll()
{
    // if this doenot work then you are not getting any data back.

    $query $this->builder->get();

    foreach ($query->getResult() as $row)
    {
        echo $row->title."<br>";
        echo $row->heading."<br>";
        echo $row->content."<br>";
    }

    // dump $query to the display
    echo var_dump($query);

    exit();

    //return $this->builder->get();


Get back to me and let me know that's just a fast way of testing a method for errors.

I wont be back on until 11:30 pm tonight but I'll check here.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Messages In This Thread
RE: Struckle with my model and the builder - "Call to a member function get() on null" - by InsiteFX - 05-15-2021, 11:53 AM



Theme © iAndrew 2016 - Forum software by © MyBB