I am trying to update the column (LastName) to NULL, if the column has empty value, else update its value using the below mysql query.
$updateUserInfo = "UPDATE `UsersNew` SET MobileNo = '".$dataArray['MobileNo']."',FirstName = '".$dataArray['FirstName']."', LastName = IF(LastName = '' OR LastName IS NULL, 'NULL', LastName), EmailId = '".$dataArray['EmailId']."' where Uid = '".$uid."';";
But the LastName value is not getting updated
I want if LastName is null i want the column to get updated as NULL
else
'".$dataArray['LastName ']."'