On Tue, Feb 27, 2007 at 10:28:47AM +0100, Daniel Verite wrote:
> If I were to give an advice on beginning with DBI, I'd suggest using prepare()
> and execute() everywhere, as opposed to easier variants like $dbh->do() or
> $dbh->selectsomething() which will distract you from the real thing.
> Then choose one method to pass query parameters (like bind_col or bind_param 
> or
> arguments to execute), and another one to retrieve SELECT resultsets (such as
> $sth->fetchrow_array or $sth->fetchrow_hashref), and stick with these.

Another approach is to use a ORM, such as Class::DBI, DBIx::Class,
Rose::DB::Object, etc. (there's many).  I think Class::DBI is still
one of the easier ORMs to get started with.  The ORMs will take care
of doing the above correctly (most of the time).

There's trade offs, of course, and there's plenty of discussion just a
google search away.



-- 
Bill Moseley
[EMAIL PROTECTED]

Reply via email to