my %incoming = &read_input; # Read information into associated # array %incoming. my $mainsearch = $incoming{'yoursearch'}; # Fetch the text from the array. my $maintable = $incoming{'yourtable'}; # Fetch the text from the array. #Start DBI my $dbh = DBI->connect("dbi:xxxxxxxxxxx", "xxxxxxx", "xxxxxxxx"); #quote the search in case the user tries to hide something nasty in there $mainsearch = $dbh->quote($mainsearch); my $st = $dbh->prepare(" select * from ( select * from qatest where UPPER(ser_app_name) like upper('%$mainsearch%') or UPPER(att_data) like upper('%$mainsearch%') or UPPER(mrserver) like upper('%$mainsearch%') or UPPER(owner_user) like upper('%$mainsearch%') or UPPER(lan_serv) like upper('%$mainsearch%') or UPPER(s_contact) like upper('%$mainsearch%') or UPPER(s_provider) like upper('%$mainsearch%') or UPPER(prod_deliv) like upper('%$mainsearch%') order by ser_app_name ASC ) where rownum < 31"); $st->execute();