At 12:30 PM -0400 7/27/99, Rich Bowen wrote:
>al wrote:
>>
>> Does anyone no a way that I can get a list of all the field names I am
>> using in a particular mysql table? That is, is there a way either using
>> the mysql command-line client or the Perl DBI module to do this?
>
>With Perl, you can ...
>
>$sth = $dbh->prepare("select * from table");
>$sth->execute;
>$Data = $sth->fetchrow_hashref;
>for (keys %$Data) {
> print "$_\n";
>}
You might want to change that query to "select * from table where 1=0"
so you don't fetch the entire table. :-)
--
Paul DuBois, paul@stripped