Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: DB Connection using CGI::Application

by scorpio17 (Canon)
on Apr 24, 2013 at 21:53 UTC ( #1030543=note: print w/replies, xml ) Need Help??


in reply to DB Connection using CGI::Application

You need to be using CGI::Application::Plugin::DBH, if you're not already, then do something like this:

sub cgiapp_init { my $self = shift; ... $self->dbh_config('mydbh', [$dsn1, $user1, $pass1, \%options1,]); $self->dbh_config('mydbh400', [$dsn2, $user2, $pass2, \%options2,]); } sub one { my $self = shift; my $dbh = $self->dbh('mydbh'); ... } sub two { my $self = shift; my $dbh = $self->dbh('mydbh400'); ... }

Replies are listed 'Best First'.
Re^2: DB Connection using CGI::Application
by Anonymous Monk on Apr 25, 2013 at 03:41 UTC

    You need to be using ...

    param will work, plugins aren't mandatory

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (9)
As of 2019-10-14 23:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?