SELECT SUM(commission) AS sum_comiss FROM moneytransfer WHERE date_transaction > last_day(now() - interval 2 month) AND date_transaction <= last_day(now() - interval 1 month)
else mysqli_query($mysqli, "INSERT INTO `notifications` VALUES ('', '".mysqli_real_escape_string($mysqli, $row['id'])."', 0, NOW(), '".mysqli_real_escape_string($mysqli, $p2)."')") or die(mysqli_error($mysqli));