perleager has asked for the wisdom of the Perl Monks concerning the following question:
use strict; use DBI; my $dbh = DBI->connect( 'dbi:mysql:golharam:serine', '', '', { RaiseError => 1, AutoCommit => 0 } ) || die "Database connection not made: $DBI::er +rstr"; 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 anyt +hing...this is where i want to print the no match message. print "$name, $title, $phone\n"; } $sth->finish(); $dbh->disconnect();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Empty Hash?
by jZed (Prior) on Dec 31, 2004 at 01:23 UTC | |
|
Re: Empty Hash?
by strat (Canon) on Dec 31, 2004 at 10:12 UTC | |
by jZed (Prior) on Dec 31, 2004 at 16:54 UTC | |
by superfrink (Curate) on Jan 01, 2005 at 01:16 UTC | |
by mpeppler (Vicar) on Jan 03, 2005 at 19:11 UTC | |
|
Re: Empty Hash?
by jbrugger (Parson) on Dec 31, 2004 at 05:41 UTC | |
by jZed (Prior) on Dec 31, 2004 at 16:53 UTC |