Welcome Guest, Not a member yet? Register   Sign In
Settings Library
#3

[eluser]InsiteFX[/eluser]
Missing semicolon!
Code:
// quick test
        if(isset($this->items[$item]))
        {
            $this->ci->db->where('item', $item);
            $this->ci->db->update($this->table, array('value' => $value));
        }
        else
        {   // the line below is missing the ending semicolon
            $this->ci->db->insert($this->table, array('item' => $item, 'value' => $value))
        }

    private function _refresh_items()
    {
        $query = $this->ci->db->get($this->table);
        $this->items = array();
        if( $query->num_rows > 0 )  // <--- should be $query->num_rows()
        {
            while($row = $query->fetch_assoc())
            {
                $item       = $row['item'];
                $value      = $row['value'];

                // do some nice filtering
                if(strtolower($value) == '{{false}}')   $value  = false;
                if(strtolower($value) == '{{true}}')    $value  = true;
                if(strtolower($value) == '{{null}}')    $value  = null;
                if(strtolower($value) == '{{empty}}')   $value  = '';

                $this->items[$item] = $value;
            }
        }
    }


Messages In This Thread
Settings Library - by El Forum - 02-01-2012, 04:31 AM
Settings Library - by El Forum - 02-01-2012, 07:12 AM
Settings Library - by El Forum - 02-01-2012, 09:10 AM
Settings Library - by El Forum - 02-01-2012, 11:14 PM
Settings Library - by El Forum - 02-02-2012, 12:54 AM
Settings Library - by El Forum - 02-02-2012, 02:01 AM
Settings Library - by El Forum - 02-02-2012, 02:35 AM
Settings Library - by El Forum - 02-02-2012, 07:33 AM
Settings Library - by El Forum - 02-02-2012, 08:29 AM
Settings Library - by El Forum - 02-03-2012, 11:21 PM
Settings Library - by El Forum - 02-03-2012, 11:58 PM
Settings Library - by El Forum - 02-04-2012, 01:10 AM
Settings Library - by El Forum - 02-04-2012, 02:34 AM



Theme © iAndrew 2016 - Forum software by © MyBB