Help! Call to a member function result

guguk

Well-known member
Jul 19, 2019
1,150
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
 

Forum statistics

Threads
69,227
Messages
908,445
Members
237,061
Latest member
itachii

About us

  • Our 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 to make sure our community is one of the best.

Quick Navigation

User Menu