title: Is there anything wrong with mysqli update Query?
body: <p>I cannot update my existing data in the tabular form of my CRUD web application. Is there anything wrong with the query ? This is my source of reference and I have follow the UPDATE query exactly as in here <a href="http://www.mustbebuilt.co.uk/php/insert-update-and-delete-with-mysqli/" rel="nofollow">INSERT, UPDATE and DELETE with mysqli</a>. This is my code.</p>
  
  <pre><code>&lt;?php
  //error_reporting(E_ALL^E_NOTICE);
  
      function chgDate($date){
      $temp=explode("-",$date);
  
      return $temp[2]."-".$temp[1]."-".$temp[0];
  }
  
  $json=array();
  
  
  $ic = $_POST['IC'];
  $Fic = $_POST['fromIC'];
  $name = $_POST['formName'];
  $tel = $_POST['formTelephone'];
  $gender = $_POST['formGender'];
  $email = $_POST['formEmail'];
  if(isset($_POST['formUni'])){
      $uni = $_POST['formUni'];
      }
  $age = $_POST['formAge'];
  $address = $_POST['formAddress'];
  $dob = $_POST['formDOB'];
  $process= $_POST['process'];
  
  //include ("connect_db.php");
  //include_once('connect_db.php');
  $db = mysqli_connect("localhost","root","admin","li") or die("Connection Error: " . mysqli_error());
  
  if($process == 'save'){
      $SQL="Insert into biodata (IC, Name, Telephone, Gender, Email, University, Age, Address, DOB) values ('$Fic', '$name', '$tel', '$gender', '$email', '$uni', '$age', '$address', '".chgDate ($dob)."')";
      $json['newrow']=$Fic;
  } else if ($process == 'edit') {
      $SQL="UPDATE biodata SET IC='$Fic', Name='$name',  Telephone='$tel', Gender='$gender', Email='$email', University='$uni', Age='$age', Address='$address, DOB ='".chgDate ($dob)."' WHERE IC= '$ic'";
  } else if ($process == 'delete') {
      $SQL = "DELETE FROM biodata WHERE IC='$ic'";
  }
  
  $data = mysqli_query($db, $SQL);
  
  if($data){
      $json['msg']='success';
  }else{
      $json['msg']='fail';
  }
  
  echo json_encode($json);
  </code></pre>
  
  <p>?></p>