saveupdate.php

 

 

<?php
$db=mysqli_connect("localhost","root","","mycompanyhr");
if($db==true){
    echo "Connection succeed!!!<br>";
}
else{
    echo "Connection fail!!!<br>";
}
  $empno=$_GET['txtempno'];
  $fullname=$_GET['txtname'];
  $deptcode=$_GET['txtdeptcode'];
  $gender=$_GET['gender'];
  
  if ($empno!=NULL){
    $sql="update employee 
        SET FULLNAME='$fullname', DEPT='$dept',   
        GENDER='$gender' 
        WHERE EMPNO='$empno' ";
        
    $rs=mysqli_query($db,$sql);
    if($rs==false){
      echo ("Query cannot be executed!<br>");
      echo ("SQL Error : ".mysqli_error($db));
    }
    else{
      echo "The update for $fullname has been saved.";
    }
  }//empno!=NULL 
?>  

Popular Posts