my $sql6 = "UPDATE table_name SET good_high = $threshold_good_high, critical_low = $threshold_critical_low, warning_low = $threshold_warning_low, warning_high = $threshold_warning_high WHERE user = ? AND name = '$threshold_name'"; my $sth6 = $dbh->prepare($sql6); $sth6->execute($userName); $update_result1 = $sth6->rows; print "\$update_result1: $update_result1\n";