Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Re: Getting a list of columns from a MySQL Table

by c (Hermit)
on Jul 22, 2002 at 22:37 UTC ( #184269=note: print w/replies, xml ) Need Help??


in reply to Re: Getting a list of columns from a MySQL Table
in thread Getting a list of columns from a MySQL Table

Thanks, I saw the fetchrow_hashref routine and tried something like:

for my $i(sort @tables) { print uc $i . "\n\n"; ## get a list of columns for the table my $sth = $dbh->prepare("LISTFIELDS $i"); $sth->execute; my $row = $sth->fetchrow_hashref(); for my $header(keys %{$row}) { print " $header\n"; } $sth->finish; sleep 1; }

but still no dice. I'll try your code and see what it yields. Thanks! -c

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://184269]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2021-06-15 13:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What does the "s" stand for in "perls"? (Whence perls)












    Results (72 votes). Check out past polls.

    Notices?