# I assume that this routine prints out the http header &header("We are done"); $query = "SELECT nw_ucountry FROM $Table"; $query .= " WHERE nw_ucountry LIKE '$country'"; my ($sth); eval { $sth = $dbh->prepare($query); $sth->execute; }; if ( $@ ) { print "

Error found executing SQL.\n", "

$query\nError: $@
"; } else { while (($qcountry) = $sth->fetchrow_array()) { ... } }