Automatic DBI column hash association


stáhnout snippet
zobrazení: SyntaxHighlighter | GeSHi | Holý text
  my $sth = $self->dbh->prepare( qq{ SHOW TABLE STATUS WHERE name = "$table" } )
    or die "Can't prepare SQL statement: $DBI::errstrn";

  $sth->execute()
    or die "Can't execute SQL statement: $DBI::errstrn";

  my %row;
  $sth->bind_columns( ( @row{ @{$sth->{NAME_lc} } } ));
  $sth->fetch;

  print "$row{update_time}n";


Tagy:
perl 11 řádků | 2008-02-04 21:01:16 | air.kadlec@seznam.cz