title: Edit User Profile in codeigniter after successfully Logged in
body: <p>After successfully Logged In to the system when click on edit profile button the profile is update and also database is update but the changes is not reflect on page. </p>
  
  <pre><code>public function editprofile()
          {
              $oActiveUser = $this-&gt;session-&gt;userdata ( 'member' );
              $iMemberId = $oActiveUser['member_id'];
              $aData['first_name'] = $this-&gt;input-&gt;post('fname');
              $aData['last_name']=$this-&gt;input-&gt;post('lname');
              $aData['email_id']=$this-&gt;input-&gt;post('emailid');
              $aData[ 'status'] = 'ACTIVE';
              $aWhere = array( 'member_id' =&gt; $iMemberId );
              $this-&gt;db_common-&gt;update( $this-&gt;sTable1 , $aData , $aWhere );
              $this-&gt;db_common-&gt;delete( $this-&gt;sTable3 , $aWhere );
              foreach($this-&gt;input-&gt;post('tech') as $technology) 
              {
                  $data = array(
                      'member_id' =&gt; (int)$iMemberId,
                      'technology_id' =&gt; $technology
                   );
              $this-&gt;db_common-&gt;insert( $this-&gt;sTable3 , $data );
              $aResp = array( 'member_techno_id' =&gt; $this-&gt;db-&gt;insert_id());
              }
              redirect('front/Dashboard');
  </code></pre>
  
  <p>This is My View page of edit profile:-</p>
  
  <pre><code>&lt;form class="form-horizontal style-form" method="post" action="&lt;?php echo base_url();?&gt;front/Profile/editprofile" name="frmprofile" id="frmprofile"&gt;
                      &lt;input type="hidden" class="form-control" name="id" id="id" value="&lt;?php echo $oActiveUser['member_id'];?&gt;"&gt;
                            &lt;div class="form-group"&gt;
                                &lt;label class="col-sm-2 col-sm-2 control-label"&gt;First Name&lt;/label&gt;
                                &lt;div class="col-sm-10"&gt;
                                  &lt;input type="text" class="form-control required" name="fname" id="fname" value="&lt;?php echo $oActiveUser['first_name'];?&gt;"&gt;
                                &lt;/div&gt;
                            &lt;/div&gt;
  
                            &lt;div class="form-group"&gt;
                                &lt;label class="col-sm-2 col-sm-2 control-label"&gt;Last Name&lt;/label&gt;
                                &lt;div class="col-sm-10"&gt;
                                    &lt;input type="text" class="form-control required" name="lname" id="lname" value="&lt;?php echo $oActiveUser['last_name'];?&gt;"&gt;
                                &lt;/div&gt;
                            &lt;/div&gt;
  
                            &lt;div class="form-group"&gt;
                                &lt;label class="col-sm-2 col-sm-2 control-label"&gt;Email Id&lt;/label&gt;
                                &lt;div class="col-sm-10"&gt;
                                    &lt;input type="text" class="form-control required" name="emailid" id="emailid" value="&lt;?php echo $oActiveUser['email_id'];?&gt;"&gt;
                                &lt;/div&gt;
                            &lt;/div&gt;
  
                            &lt;div class="form-group"&gt;
                                &lt;label class="col-sm-2 col-sm-2 control-label"&gt;Technologies&lt;/label&gt;
                                &lt;div class="col-sm-10"&gt;
                                   &lt;?php if(@$aTechCount&gt;0){
                                      foreach( $aTechnology as $oType ){ ?&gt;
                                        &lt;li style="list-style-type:none;"&gt;&lt;input type="checkbox" name="tech[]" value="&lt;?php echo @$oType-&gt;technology_id; ?&gt;" &lt;?php if( in_array(@$oType-&gt;technology_id,$memTech)){ echo "checked";}?&gt;&gt; &lt;?php echo strtoupper(@$oType-&gt;technology_name); } }?&gt;&lt;/li&gt;
                                &lt;span id="check_error" style="color:red;font-weight:bold;"&gt;&lt;/span&gt;     
                                &lt;/div&gt;
                            &lt;/div&gt;
  
                            &lt;center&gt;&lt;input type="submit" class="btn btn-theme" name="upadate" id="update" value="Update" style="margin-bottom:5px;"&gt;&lt;center&gt;
                      &lt;/form&gt; 
  </code></pre>
  
  <p>this is my edit profile code when i redirect to dashboard and again click on edit profile the updated data should not display in form.</p>
  
  <p>This is My Edit profile controller loads view</p>
  
  <pre><code>public function index()
      {
          $oActiveUser = $this-&gt;session-&gt;userdata ( 'member' );
          $id = $oActiveUser['member_id'];
          $sQuery = $this-&gt;db-&gt;query("SELECT technology_id FROM `member_technology` WHERE member_id = '$id'")-&gt;result();
          $tech_array = array();
          foreach($sQuery as $jQry){
              $tech_array [] = $jQry-&gt;technology_id;
          }
          $aData['memTech'] = $tech_array;
          $aWhere[ 'member_id' ] = $id;
          $aData[ 'aTechnology' ] = $this-&gt;db_common-&gt;get_data();
          $aData[ 'aTechCount' ] = count( $aData[ 'aTechnology' ] );
          $this-&gt;load-&gt;view('front/header');
          $this-&gt;load-&gt;view('front/editprofile',$aData);
          $this-&gt;load-&gt;view('front/footer');
      }
  </code></pre>