in reply to Getting HASHES out of Class::DBI
To set up a method named sql_getusers, which can be passed a username, and later to use it:App::User->set_sql('getusers', 'select * from __TABLE__ where username + = ?');
Or any of the other fetch methods listed in Ima::DBI. This one actually gets you an array of hashrefs, one for each of the answers, containing column names as keys, and values in the values.my $sth = App::User->sql_getusers(); $sth->execute('fred'); my $hash = $sth->fetchall_hash();
Class::DBI seems to be good in simple cases, but complex in complicated ones.. (whereas DBI is complex all over, but once you learn it, you'll be able to do everything..
C.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Getting HASHES out of Class::DBI
by rkg (Hermit) on Jan 07, 2004 at 04:12 UTC | |
|
Re: Re: Getting HASHES out of Class::DBI
by jdtoronto (Prior) on Jan 07, 2004 at 02:21 UTC |