Welcome Guest, Not a member yet? Register   Sign In
Database::updateProfile()
#1

[eluser]GamingFusion[/eluser]
I have a site that will allow a user to update their profile.

The problem im having is that it says the my updateProfile() function in my database model is there even though it is.

Why? i loads other functions like updateShow()

ERROR
Quote:Fatal error: Call to undefined method Database::updateProfile() in /Users/User1/Sites/ci/system/application/controllers/members.php on line 307

Model
Code:
function updateProfile($id)
    {
        $data = array(
            'first' => $this->input->post('first'),
            'last' => $this->input->post('last'),
            'username' => $this->input->post('username'),
            'position' => $sthis->input->post('position'),
            'bio' => $this->input->post('bio'));
        
        $this->db->set($data);

        $this->db->where('id', $id);
        $query = $this->db->update('users');
        
        if ($query) {
            return $data['updated'] = TRUE;
            return $query;
        }else{
            return $data['updated'] = FALSE;
        }
    }

controller
Code:
function update()
    {
        $this->database->updateProfile($this->uri->segment(3)); //this is line 307
    }
#2

[eluser]n0xie[/eluser]
Do you by any chance run PHP4? If so database is a reserved name and you should name your model something else.
#3

[eluser]GamingFusion[/eluser]
nope im running it on a local server with PHP 5
#4

[eluser]GamingFusion[/eluser]
it work ever other place i use function from it
#5

[eluser]GamingFusion[/eluser]
i fixed it. It was a bracket that was out of place




Theme © iAndrew 2016 - Forum software by © MyBB