my $sth = $dbh->prepare(" UPDATE products set pname=?, unit=?, qty=?, cost=? WHERE id = ? "); $sth->execute($pname, $unit, $qty, $cost, $id);