Changeset 432 for trunk/cgi-bin/IPDB.pm


Ignore:
Timestamp:
07/16/10 17:31:13 (14 years ago)
Author:
Kris Deugau
Message:

/trunk

Clarify, clean up, and make sane configuration for database
host, db name, user, and password. See #17.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cgi-bin/IPDB.pm

    r429 r432  
    130130# Set up for a PostgreSQL db;  could be any transactional DBMS with the
    131131# right changes.
    132 # This definition should be sub connectDB($$$) to be technically correct,
    133 # but this breaks.  GRR.
    134132sub connectDB {
    135   my ($dbname,$user,$pass) = @_;
     133  my $dbname = shift;
     134  my $user = shift;
     135  my $pass = shift;
     136  my $dbhost = shift;
     137
    136138  my $dbh;
    137   my $DSN = "DBI:Pg:host=ipdb-db;dbname=$dbname";
    138 #  my $user = 'ipdb';
    139 #  my $pw   = 'ipdbpwd';
     139  my $DSN = "DBI:Pg:".($dbhost ? "host=$dbhost;" : '')."dbname=$dbname";
    140140
    141141# Note that we want to autocommit by default, and we will turn it off locally as necessary.
Note: See TracChangeset for help on using the changeset viewer.