- or download this
my $stmt = "SELECT * FROM $table WHERE $key_col = '$key_val'";
my $sth = $dbhandle->prepare( $stmt );
$sth->execute();
- or download this
my $stmt = "SELECT * FROM $table WHERE $key_col = ?";
my $sth = $dbhandle->prepare( $stmt );
$sth->execute($key_val);
- or download this
my $ref = $sth->fetchall_arrayref();
$sth->finish();
return map { $_->[$name_col] => $_->[$val_col] } @$ref;
- or download this
my $ref = $sth->fetchall_hashref([$name_col,$val_col]);
$sth->finish();
return map {@$_} @$ref;
- or download this