title: how to update user database for current user login in php?
body: <p>i try find answer through this website but every try i do, i got error.. why?
  i want the user that login, enable to update their own information. but everytime i click update, nothing is update and keep show "error" here my update.php page script</p>
  
  <pre><code> &lt;?php
   include '../config/config.php';
  
  $name = $_POST['name'];
  $hobbies = $_POST['hobbies'];
  $height = $_POST['height'];
  $weight = $_POST['weight'];
  $blood_presure = $_POST['blood_presure'];
  $heart_rate = $_POST['heart_rate'];
  
  
  $query = "UPDATE user_info SET name = '$name', hobbies =' $hobbies', height = '$height', weight = '$weight', blood_presure = '$blood_presure' heart_rate = $heart_rate' WHERE   $sessions = '".$_SESSION['user']."'";
  
    $result = mysql_query($query);
   if($result){
   header("location:../dashboard.php");
   }
  
  else {
  echo "ERROR";
  } 
  
  
  
  mysql_close();
  ?&gt;
  </code></pre>
  
  <p>what my mistake, is it correct on how i set WHERE for the user that currently login to update their own data?</p>