title: Update query sql deletes content of other fields from database
body: <p>I have a database with a tblUsers with following fields
  1. DiaryLighton | DiaryLichtoff | DiarySleep | DiaryAwake | FeedbackUser | FeedbackDoctor</p>
  
  <p>When I'm on the diary-page I need to fill in the DiaryLighton | DiaryLightoff | DiarySleep | DiaryAwake after clicking the save button. The same should happen on the Feedback - page. After clicking the button the FeedbackUser | FeedbackDoctor should be filled in. </p>
  
  <p><strong>Problem however is, that it saves the data, but when I save the diary after saving the feedback, the content of the feedback disappears out of the table and the other way around.</strong></p>
  
  <p>Someone any clue? Here's the code. Thanks!</p>
  
  <p>Save the diary:</p>
  
  <pre><code>public function saveDay($p_iUserid) {
      include("Connection.php"); //open connection to database
  
      $sql="UPDATE tblDiary
                       SET
                            DiaryLichtAan = '".$this-&gt;Aanuur."',
                            DiaryLichtUit = '".$this-&gt;Uituur."',
                            DiaryOpstaan = '".$this-&gt;Opstaan."',
                            DiaryGaanSlapen = '".$this-&gt;Slapen."'
                       WHERE fk_UserId = ".$p_iUserid."
                       and DiaryDay = '".$this-&gt;Day."';"; 
      try
      {
          $link-&gt;query($sql); 
      }
      catch(Exception $e)
      {
          $feedback = $e-&gt;getMessage();   
      }   
  
      mysqli_close($link); //close connection with database
  }
  </code></pre>
  
  <p>AJAX: </p>
  
  <pre><code>$(".submitbutton").click( function() {
      var aanuur = $(".onzichtbaar_aan").val();
      var uituur = $(".onzichtbaar_uit").val();               
      var opstaan = $(".onzichtbaar_opstaan").val();
      var slapen = $(".onzichtbaar_slapen").val();
      var feeling = $("#onzichtbaar_feeling").val();
      var day = $(".confirmday").val();
  
      $.post("ajax/save.php", {lichtaan: aanuur, 
                              lichtuit: uituur, 
                              slapen: slapen, 
                              opstaan: opstaan, 
                              feeling: feeling,
                              userid: &lt;?php echo $_SESSION['id']; ?&gt;,
                              day: day},
              function(data) {
      });
      return false;
  });
  </code></pre>
  
  <p>Save the feedback:</p>
  
  <pre><code>public function saveFeedbackP($p_iUserid) {
      include("Connection.php");
  
      try
      {
          $sql = "UPDATE tblDiary
                  SET 
                      DiaryOpmerkingen = '".$this-&gt;Patientfb."'
                  WHERE fk_UserId = ".$p_iUserid." 
                  AND DiaryDay = ".$this-&gt;Day.";";
          $rResult = mysqli_query($link, $sql);
          return $rResult;
      }
      catch(Exception $e)
      {
          // no connection database
          $feedback = $e-&gt;getMessage();
      }
      mysqli_close($link);
  }
  </code></pre>