title: how update value input form class result
body: <p>I Have a profile page and admin can edit profile users,
  all process on one page done,How i can refresh and update value form data after success query update ?
  User.class file :</p>
  
  <pre><code>class User {
  ...
  
      public function updateUser($id, $firstname, $lastname, $phone, $birthday, $managerid)
  {
      $con = $this-&gt;DBconnect();
      $id = (int)$id;
      $managerid = $this-&gt;checkParam($managerid);
      $firstname = $firstname;
      $lastname = $lastname;;
      $mobile = $phone;
      $birthday = $this-&gt;checkParam($birthday);
  
  
      $query = "UPDATE `users` SET `manager_id` = :manager_id,`firstname` = :firstname,`lastname` = :lastname,`birthday` = :birthday,`mobile` = :mobile WHERE `id` = :id";
      $result = $con-&gt;prepare($query);
      $result-&gt;BindParam(':id', $id, PDO::PARAM_INT);
      $result-&gt;BindParam(':manager_id', $managerid, PDO::PARAM_INT);
      $result-&gt;BindParam(':firstname', $firstname);
      $result-&gt;BindParam(':lastname', $lastname);
      $result-&gt;BindParam(':birthday', $birthday);
      $result-&gt;BindParam(':mobile', $mobile);
  
      $check = $result-&gt;execute();
          return true;
  
  
  }}
  </code></pre>
  
  <p>profile.php file :</p>
  
  <pre><code>  &lt;?php
  if (isset($_GET['id'])) {
      $id = (int)$_GET['id'];
  }
  $user = new User();
  $user_info = $user-&gt;getuser($id);
  while ($info = $user_info-&gt;fetch(PDO::FETCH_ASSOC)) {
      $firstname = $info['firstname'];
      $lastname = $info['lastname'];
      $mobile = $info['mobile'];
      $birthday = $info['birthday'];
      $managerid = $info['manager_id'];
  
  }
  $manager_ob = new Manager();
  $managers = $manager_ob-&gt;getAllManager();
  $managers_name = array();
  while ($manager = $managers-&gt;fetch(PDO::FETCH_ASSOC)) {
      $managers_list[] = $manager;
  
  }
  if (isset($_POST['edit-profile'])) {
      $update_result = $user-&gt;updateUser($_POST['user_id'],$_POST['user_firstname'],$_POST['user_lastname'],$_POST['user_mobile'],$_POST['user_birthday'],$_POST['manager_id']);
      if($update_result){
          echo 'Profile Edited';
  
      }
  }
  ?&gt;
  
    &lt;form method="post" action="#" class="form-horizontal"&gt;
      &lt;div class="form-group"&gt;&lt;label class="col-sm-2 control-label"&gt;ID&lt;/label&gt;
  
      &lt;div class="col-sm-10"&gt;&lt;input type="text" readonly class="form-control" name="user_id" id="user_id" value="&lt;?php echo check_param($id); ?&gt;"/&gt;&lt;/div&gt;
                                  &lt;/div&gt;
                                  &lt;div class="form-group"&gt;&lt;label class="col-sm-2 control-label"&gt;Firstname&lt;/label&gt;
  
                                      &lt;div class="col-sm-10"&gt;&lt;input type="text" class="form-control" name="user_firstname" value="&lt;?php echo check_param($firstname); ?&gt;" /&gt;&lt;/div&gt;
                                  &lt;/div&gt;
                                  &lt;div class="form-group"&gt;&lt;label class="col-sm-2 control-label"&gt;Lastname&lt;/label&gt;
  
                                      &lt;div class="col-sm-10"&gt;&lt;input type="text" class="form-control" name="user_lastname" value="&lt;?php echo check_param($lastname); ?&gt;"/&gt;&lt;/div&gt;
                                  &lt;/div&gt;
                                  &lt;div class="form-group"&gt;&lt;label class="col-sm-2 control-label"&gt;Phone&lt;/label&gt;
  
                                      &lt;div class="col-sm-10"&gt;&lt;input type="text" class="form-control" name="user_mobile" value="&lt;?php echo check_param($mobile); ?&gt;"/&gt;&lt;/div&gt;
                                  &lt;/div&gt;
                                  &lt;div class="form-group"&gt;&lt;label class="col-sm-2 control-label" for="birthday"&gt;Birthday
                                          &lt;/label&gt;
  
                                      &lt;div class="col-sm-10"&gt;&lt;input id="birthday" type="text" class="form-control" name="user_birthday"&gt;&lt;/div&gt;
                                  &lt;/div&gt;
                                  &lt;div class="form-group"&gt;&lt;label class="col-sm-2 control-label"&gt;Manager&lt;/label&gt;
  
                                      &lt;div class="col-sm-10"&gt;&lt;select class="form-control m-b" name="manager_id"&gt;
  
                                              &lt;?php foreach ($managers_list as $managers_n) { ?&gt;
  
                                                  &lt;option &lt;?php if ($managers_n['id'] == $managerid) {
                                                      echo 'selected';
                                                  } ?&gt;
                                                      value="&lt;?php echo $managers_n['id']; ?&gt;"&gt; &lt;?php echo $managers_n['name']; ?&gt;&lt;/option&gt;;
                                              &lt;?php }
                                              ?&gt;
  
                                          &lt;/select&gt;
  
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                                  &lt;input type="submit" name="edit-profile" class="btn btn-block btn-w-m btn-success"
                                         value="Edit profile"&gt;
                              &lt;/form&gt;
  </code></pre>
  
  <p>i load profile data after submit edit :</p>
  
  <pre><code>$update_result = $user-&gt;updateUser($_POST['user_id'],$_POST['user_firstname'],$_POST['user_lastname'],$_POST['user_mobile'],$_POST['user_birthday'],$_POST['manager_id']);
  if($update_result){
      echo 'Profile Edited';
  
  }
  </code></pre>
  
  <p>only display message Profile Edited but must be refresh page for renew data
  I must  fetch again query for update values?  or have better way ?</p>