in reply to DBI and bind_columns issue
As mentioned by anon-monk, you do not want/need $row with binding columns like this
my %row; my $sth = $dbh->prepare ("SELECT tm_club_district, tm_club_number FROM + clubs WHERE tm_club_district = ?"); $sth->execute ($district); # Bind fetch to $row{tm_club_district} and $row{tm_club_number} $sth->bind_columns (\( @row{@{$sth->{NAME_lc}}} )); # fetch without bind_columns is an alias to fetchrow_arraref (returnin +g $row) # but *with* bind_columns you use the return values as boolean while ($sth->fetch) { print $row{tm_club_number} . " - " . $row{tm_club_district} ."\n"; } print "END\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: DBI and bind_columns issue
by nelgin (Initiate) on Aug 15, 2014 at 13:35 UTC |