use DBI; my $dbh = DBI->connect('DBI:mysql:CLTE') or die "Couldn't connect to database: " . DBI->errstr; $sql = " SELECT * FROM clttable WHERE clt = '$INPUT{'clt'}%' #also tried replacing % with * character. "; $sth = $dbh->prepare("$sql") or print "preparing: ",$dbh->errstr; $sth->execute or print "executing: ", $dbh->errstr; $row = $sth->fetchrow_hashref; $dbh->disconnect;