Welcome Guest, Not a member yet? Register   Sign In
Error unexpected T_OBJECT_OPERATOR
#1

[eluser]Rubiz'[/eluser]
Hello everyone...

Can you help me with his error please? I have moved my app from localhost to my domain, but it crashed... why this error?!
Code:
function get_content_by_locale($slug, $locale='pt')
    {
        $this->db->where('slug', $slug);
        $res = $this->db->get('content')->result(); // << this line generates the error!
        
        if ($locale == 'pt') return $res[0]->pt;
        else return $res[0]->en;
    }
What can I do now?!? \0/

Thank you for the support...

================ edited =====================

If I write:
Code:
$res = $this->db->get('content');
$res = $res->result();
It's ok... anyone can explain?!?!
#2

[eluser]tonanbarbarian[/eluser]
the live server is probably an older version of PHP that does not support object chaining.




Theme © iAndrew 2016 - Forum software by © MyBB