if ($q->param("update")) { my $sql = "UPDATE property SET address_1= ?,address_2= ?, county= ?, city= ?, zip= ?, description= ?, bedroom= ? WHERE property_id= ?"; my $sth = $dbh->prepare($sql) or die $dbh->errstr; $sth->execute($address_1, $address_2, $county, $city, $zip, $description, $bedroom,$property_id) or die $dbh->errstr; $dbh->disconnect; print $q->header(), $q->start_html("Cool "), $q->p("that worked fine\n $sql"), $q->end_html; }else { print $q->header(), $q->start_html("ERROR"), $q->p("life sucks dude"), $q->end_html; exit; }