Welcome Guest, Not a member yet? Register   Sign In
My controller doesnt update database any suggestions
#1

[eluser]adityajoshi[/eluser]
Code:
$user = $this->session->userdata('userid');
        Doctrine::getTable('Profile')->find($user);
        $e = new Profile;
        $e->user_id = $this->session->userdata('userid');
        $e->name = $this->input->post('pname');
        $e->Sex =  $this->input->post('sex');
        $e->City =  $this->input->post('city');
        $e->DOB = $this->input->post('stats');
        $e->Interests = $this->input->post('interests');
        $e->save();
         $this->load->view('profile');

}
my model
Code:
<?php
class Profile extends Doctrine_Record {

    public function setTableDefinition() {
    $this->hasColumn('user_id', 'string', 255);
    $this->hasColumn('name', 'string', 255);
    $this->hasColumn('City', 'string', 255);
    $this->hasColumn('Sex', 'string', 255);
    $this->hasColumn('DOB','date');
    $this->hasColumn('image_loc','string',255);
    $this->hasColumn('Interests', 'string', 255);
    
    
    }
    
    public function setUp() {
        $this->setTableName('Profile');
        $this->actAs('Timestampable');
    }

    
}




Theme © iAndrew 2016 - Forum software by © MyBB