DBI and DBD::mysql pseudohash results set?
am 18.09.2004 13:02:18 von Dan BolserHi,
I was thinking about loading the rows of a $sth results set into a
pseudohash so that the columns could be accessed by either the column name
or the column index.
This functionality is supported by a pseudohash
Snipet from http://perlmonks.thepen.com/19636.html
$struct = [{foo => 1, bar => 2}, "FOO", "BAR"];
$struct->{foo}; # same as $struct->[1], i.e. "FOO"
$struct->{bar}; # same as $struct->[2], i.e. "BAR"
__END__
However, I heard that the way pseudohashes work may change, and
pseudohash code may become obsolete or broken.
Snipet from
http://www.perl.com/pub/a/2001/05/p5pdigest/THISWEEK-2001052 0.html
Michael Schwern asked that pseudo-hashes should be removed from Perl 5.8
and onwards.
__END__
Is the above style of lookup already handled by DBI? You can do it in PHP.
Any feedback would be welcome,
All the best,
Dan.
--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org