Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Is there a better way to do this, perhaps with using INFORMATION SCHEMA now available in MySQL 5, which I am using? Thanks monks.foreach my $tablename (@tables) { my $sth = $dbh->prepare(qq{select * from $tablename limit 1}); + $sth->execute(); my @fields = @{$sth->{NAME}}; for (0 .. $#fields) { $default_column{$fields[$_]} = $sth->{mysql_is_num}[ $_] ? 0 : '""'; } $table_columns{$tablename} = \@fields; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Selecting from multiple tables
by anonymized user 468275 (Curate) on Jul 20, 2005 at 11:19 UTC |