Help! Call to a member function result

  • Welcome to Babiato Forum! All Resources are 100% clean and Safe to Use

guguk

Well-known member
Banned User
Jul 19, 2019
1,151
828
113
Ottoman Empire
Hello guys,
My friend has a website which created with CodeIgniter. And the website getting 500 error. I checked htaccess and error log. There is no problem with htaccess but when I checked error log and it has PHP Fatal Error:

PHP Fatal error: Call to a member function result() on boolean in .../application/models/CommonModel.php on line 18

When i looked up that line:

PHP:
public function getLanguages()
    {
        
        $response = array();

        $response['list'] = $this->db->where('status',true)->get('languages')->result();
        $response['default'] = $this->db->where('default',1)->get('languages')->row();

        foreach ($response['list'] as $key => $value) {
            $response['codes'][] = $value->code;
        }

        return $response;

    }

Line 18 is
PHP:
$response['list'] = $this->db->where('status',true)->get('languages')->result();
Im not expert of PHP so could you please help me how to fix that?

Thnx
 

About us

  • Babiato Forum - The webmaster community has been around for many years and pride ourselves on offering unbiased, critical discussion among people of all different backgrounds. We are working every day, updating Daily resource to make sure our community is one of the best.

Quick Navigation

User Menu