Hrunting has asked for the wisdom of the Perl Monks concerning the following question:
According to the DBD::mysql man page, you can do something like this to get a statement handle that will give you the names of the fields in your table.
My problem is, what do I do with that statement handle once I have it? None of the "traditional" statement handle methods return any data, and I've failed to find any special methods in the DBD::mysql docs.my $sth = $dbh->prepare( "LISTFIELDS $table" );
On a side note, does anyone know of a more elegant, cross-database solution to this problem? I could do a pull, LIMIT 1, and then grab the field names out of a $sth->fetchrow_hashref(), but that's kind of a waste of a pull.
And on a further side note, I tried searching for LISTFIELDS on perlmonks, but apparently, I'm not allowed permission to that node. Bummer.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DBD::mysql LISTFIELDS?
by dkubb (Deacon) on Jan 16, 2001 at 07:35 UTC | |
|
Re: DBD::mysql LISTFIELDS?
by wardk (Deacon) on Jan 16, 2001 at 07:18 UTC |