Q1: Write the code in PHP MYSQL to update the salary of the employee where where name is ali and salary is an even number. (4)
CNIC
Name
Salary
Mobile Number
$sql = "update employee set salary='$value' where name='$name' and '$salary%2==0'";
if(mysqli_query($link, $sql)){
echo "Records updated successfully.";
} else{
echo "ERROR: Could not able to execute $sql. " . mysqli_error($link);
}
Comments
Leave a comment