List:General Discussion« Previous MessageNext Message »
From:Rich Bowen Date:July 27 1999 4:30pm
Subject:Re: Getting field names from a given table
View as plain text  
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";
}

Rich
-- 
It seems to me as we make our own few circles 'round the sun
We get it backwards and our seven years go by like one 
          --Rush, 'Dog Years' (Test for Echo, 1996)
Thread
Getting field names from a given tableal27 Jul
  • Re: Getting field names from a given tablePaul DuBois27 Jul
  • Re: Getting field names from a given tableJeff Urban27 Jul
  • Getting field names from a given tablesinisa27 Jul
  • Re: Getting field names from a given tableRich Bowen27 Jul
    • Re: Getting field names from a given tablePaul DuBois27 Jul