in reply to getting the columns names from a mysql query
I'm wondering if you are approaching this the right way. Normally I'm stuffing these $row's into an array and then dereferencing them when I need it.
I usually end up writing something more like:while (my $row = $sth->fetchrow_hashref) { push(@profiles,$row); }
then you deref @profiles as you go
foreach (@profiles) { print "$_->{user_id}\n"; }
A couple of other things I noticed
$storedProfile = {};also you can rewrite this
@keys = keys %row; for (@keys){
foreach (keys %row) {
| Unix - where you can thrown the manual on the keyboard and get a command |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: getting the columns names from a mysql query
by Anonymous Monk on May 02, 2002 at 05:08 UTC |