[pm-h] Fields names froma table

Michael Dickens cmdickens at gmail.com
Thu Mar 11 11:43:17 PST 2010


Hi Fraser,
have you tried using a query 'DESC my_table' and then fetchrow_array
something like:

my $sth = $dbh->prepare("DESC my_table");
$sth->execute();
my @fields = $sth->fetchrow_array;
$sth->finish();



Michael

On Thu, Mar 11, 2010 at 11:32 AM, Fraser Baker <flbaker at sbcglobal.net>wrote:

>  Hi:
>
> OK, I finally have a question.
>
> How do I get a list of field names from a mySQL table using DBI? I don't
> need the values.
>
> I have put my time in, but can't get it to work.
>
> Fraser
>
> _______________________________________________
> Houston mailing list
> Houston at pm.org
> http://mail.pm.org/mailman/listinfo/houston
> Website: http://houston.pm.org/
>



-- 
easy as Perl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/mailman/private/houston/attachments/20100311/60be1bd3/attachment.html>


More information about the Houston mailing list