title: SQL + PHP Update query
body: <p>I've been trying to update my data according to the user session (UserLogin) but it kept saying: Data type mismatch in criteria expression. The <code>print_r</code> is just for testing purposes.</p>
  
  <p>Thanks in advance,</p>
  
  <p>Z</p>
  
  <pre><code>function Employee1_BeforeShow(&amp; $sender)
  {
      $Employee1_BeforeShow = true;
      $Component = &amp; $sender;
      $Container = &amp; CCGetParentContainer($sender);
      global $Employee1; //Compatibility
  
  
  $Page = CCGetParentPage($sender);
  
  $db = $Page-&gt;Connections["PettyCashMDB"];
  
  $sql1 = "UPDATE Employee SET Employee.LastActive = Date() WHERE Employee.[EmpID] = ". $_SESSION['UserLogin'];
  $db-&gt;query($sql1);
  
  print_r($_SESSION['UserLogin']);
  
  
  
  $db-&gt;close();
  Employee1_BeforeShow @67-67106FAD
  return $Employee1_BeforeShow;
  }
  </code></pre>
  
  <p>EDIT: I've tried @NanaPartykar 's method and by accident I've noticed that it does get the value from <code>$_SESSION['UserLogin']</code>, just that somehow the datatype is different.</p>
  
  <p>EDIT: It displays the error <code>Data type mismatch</code> but both of them are string and returns string.</p>