Welcome Guest, Not a member yet? Register   Sign In
Undefined variable: query
#1

[eluser]GamingFusion[/eluser]
I have a page that needs to get data from the database and place it into fields but my function in the model i think isnt working right but i not sure what isn't working

Controller
Code:
function general()
    {
        $this->adminCheck();
        
        $this->database->getFieldsAll('info');
        
        if ($query)
        {
            $query = "SELECT * FROM info ";
            $result = $this->db->query($query);
            $check = $result->num_rows();
            
            if ($check > 0)
            {
                $data['siteName'] =  $this->input->post('sitename');
                $data['siteUrl'] =  $this->input->post('siteurl');
                $data['adminEmail'] =  $this->input->post('admine');
                $data['welcome'] =  $this->input->post('welcome');
            }
        }
        
        //Set Data
        $data['title'] = 'Theater 311 | General Settings';
        $data['heading'] = 'General Settings';
        $data['css'] = 'site';
        $data['content'] = 'admin/general';
        
        //Load View
        $this->load->view('admin/template/index', $data);
    }

model
Code:
function getFieldsAll($table)
    {
        $query = $this->db->get($table);
        
        if ($query->num_rows == 1)
        {
            return true;
        }
    }


Messages In This Thread
Undefined variable: query - by El Forum - 11-13-2009, 11:32 PM
Undefined variable: query - by El Forum - 11-14-2009, 02:32 AM
Undefined variable: query - by El Forum - 11-14-2009, 07:49 AM



Theme © iAndrew 2016 - Forum software by © MyBB