Update Database tables with values input by user in CodeIgniter using PHP
<p>I'm trying to update one of my user tables in the Database with values taken from the the user. But for some reason it's not updating anything.</p>

<p><strong>HTML Form</strong></p>

<pre><code>&lt;form class="form-horizontal" method = "post"&gt;
&lt;fieldset&gt;

    &lt;!-- Form Name --&gt;
    &lt;legend&gt;User Details&lt;/legend&gt;

    &lt;div&gt;
        &lt;?php echo $this-&gt;session-&gt;flashdata('msg'); ?&gt;
    &lt;/div&gt;

    &lt;!-- Text input--&gt;
    &lt;div class="form-group"&gt;
        &lt;label class="col-md-4 control-label" for="name"&gt;Full Name&lt;/label&gt;
        &lt;div class="col-md-8"&gt;
            &lt;input id="name" name="name" type="text" placeholder="something" class="form-control input-md"&gt;

        &lt;/div&gt;
    &lt;/div&gt;

    &lt;!-- Text input--&gt;
    &lt;div class="form-group"&gt;
        &lt;label class="col-md-4 control-label" for="dob"&gt;Date of Birth&lt;/label&gt;
        &lt;div class="col-md-4"&gt;
            &lt;input id="dob" name="dob" type="text" placeholder="" class="form-control input-md"&gt;

        &lt;/div&gt;
    &lt;/div&gt;

    &lt;!-- Multiple Radios --&gt;
    &lt;div class="form-group"&gt;
        &lt;label class="col-md-4 control-label" for="gender"&gt;Gender&lt;/label&gt;
        &lt;div class="col-md-2"&gt;
            &lt;select id="gender" name="gender" class="form-control"&gt;
                &lt;option value="1"&gt;Male&lt;/option&gt;
                &lt;option value="2"&gt;Female&lt;/option&gt;
            &lt;/select&gt;
        &lt;/div&gt;
    &lt;/div&gt;

    &lt;!-- Text input--&gt;
    &lt;div class="form-group"&gt;
        &lt;label class="col-md-4 control-label" for="degree"&gt;Degree&lt;/label&gt;
        &lt;div class="col-md-8"&gt;
            &lt;input id="degree" name="degree" type="text" placeholder="degree" class="form-control input-md"&gt;

        &lt;/div&gt;
    &lt;/div&gt;

    &lt;!-- Text input--&gt;
    &lt;div class="form-group"&gt;
        &lt;label class="col-md-4 control-label" for="specialization"&gt;Specialization&lt;/label&gt;
        &lt;div class="col-md-8"&gt;
            &lt;input id="specialization" name="specialization" type="text" placeholder="specialization" class="form-control input-md"&gt;

        &lt;/div&gt;
    &lt;/div&gt;

    &lt;!-- Select Basic --&gt;
    &lt;div class="form-group"&gt;
        &lt;label class="col-md-4 control-label" for="year"&gt;Degree Year&lt;/label&gt;
        &lt;div class="col-md-2"&gt;
            &lt;select id="year" name="year" class="form-control"&gt;
                &lt;option value="1"&gt;1&lt;/option&gt;
                &lt;option value="2"&gt;2&lt;/option&gt;
                &lt;option value="3"&gt;3&lt;/option&gt;
                &lt;option value="4"&gt;4&lt;/option&gt;
                &lt;option value="5"&gt;5&lt;/option&gt;
            &lt;/select&gt;
        &lt;/div&gt;
    &lt;/div&gt;

    &lt;!-- Select Basic --&gt;
    &lt;div class="form-group"&gt;
        &lt;label class="col-md-4 control-label" for="semester"&gt;Semester&lt;/label&gt;
        &lt;div class="col-md-2"&gt;
            &lt;select id="semester" name="semester" class="form-control"&gt;
                &lt;option value="1"&gt;1&lt;/option&gt;
                &lt;option value="2"&gt;2&lt;/option&gt;
            &lt;/select&gt;
        &lt;/div&gt;
    &lt;/div&gt;

    &lt;!-- File Button --&gt;
    &lt;div class="form-group"&gt;
        &lt;label class="col-md-4 control-label" for="filebutton"&gt;Upload Profile Picture&lt;/label&gt;
        &lt;div class="col-md-4"&gt;
            &lt;input id="filebutton" name="filebutton" class="input-file" type="file"&gt;
        &lt;/div&gt;
    &lt;/div&gt;

    &lt;!-- Button --&gt;
    &lt;div class="form-group"&gt;
        &lt;label class="col-md-4 control-label" for="submit"&gt;&lt;/label&gt;
        &lt;div class="col-md-4"&gt;
            &lt;a href="&lt;?php echo base_url("/index.php/studentDashboardController/saveUserDetails"); ?&gt;" &gt;
                &lt;button id="submit" name="submit" class="btn btn-primary"&gt;Save Changes&lt;/button&gt;
            &lt;/a&gt;
        &lt;/div&gt;
    &lt;/div&gt;

&lt;/fieldset&gt;
</code></pre>

<p></p>

<p><strong>studentDashboardController</strong></p>

<pre><code>public function  saveUserDetails()
{
     $this-&gt;load-&gt;model('userModel');
     if (isset($this-&gt;session-&gt;userdata['logged_in']))
     {
          $username = ($this-&gt;session-&gt;userdata['logged_in']['username']);
     }
     $user = $this-&gt; userModel-&gt; getUserUid($username); //Gets the uid of the current user
     $this-&gt;userModel-&gt;saveUserDetails($user);
     $this-&gt;session-&gt;set_flashdata('msg', '&lt;div class="alert alert-success text-center"&gt;Successfully Inserted Data&lt;/div&gt;');
     $this-&gt;load-&gt;view('studentDashboard/common',$data);
     redirect(base_url('index.php/studentDashboard/editProfile',$data1));
}
</code></pre>

<p><strong>userModel</strong></p>

<pre><code>public function saveUserDetails($uid)
{
    $data = array(
         'name' =&gt; $this-&gt;input-&gt;post('name')
    );
    $this-&gt;db-&gt;where("uid",$uid);
    $this-&gt;db-&gt;update("sysuser",$data);
}
</code></pre>

<p>The sysuser has the uid and name fields.I' not sure what I'm doing wrong here. Any help in this regard will be appreciated</p>