use strict; use DBI; my $dbh = DBI->connect( 'dbi:mysql:golharam:serine', '', '', { RaiseError => 1, AutoCommit => 0 } ) || die "Database connection not made: $DBI::errstr"; my $sql = qq{ SELECT id, name, title, phone FROM employees }; my $sth = $dbh->prepare( $sql ); $sth->execute(); my( $id, $name, $title, $phone ); $sth->bind_columns( undef, \$id, \$name, \$title, \$phone ); while( $sth->fetch() ) { #lets say sth->fetch() doesn't return anything...this is where i want to print the no match message. print "$name, $title, $phone\n"; } $sth->finish(); $dbh->disconnect();