I believe we've tried that as well.  We've tried single quotes, no
quotes and double quotes.  Non seem to work.

Robbert van Andel 



-----Original Message-----
From: Brent Michalski [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 21, 2003 9:10 AM
To: Van Andel, Robbert
Cc: [EMAIL PROTECTED]
Subject: Re: Database connection trouble



I am guessing you want to do this instead:

my $dsn = "DBI:$driver:database=$database;host=$hostname";

By using the single quote, Perl will not interpolate the variable
names...


Brent





 

                      "Van Andel,

                      Robbert"                 To:
<[EMAIL PROTECTED]>

                      <RVanAndel@charte        cc:       (bcc: Brent
Michalski/STL/MASTERCARD)                                         
                      rcom.com>                Subject:  Database
connection trouble                                                   
 

                      02/21/2003 11:01

                      AM

 

 





A coworker and I have been working on connecting to a MySQL database
running on the webserver.  We are using the following command to
connect:

my $dsn = 'DBI:$driver:database=$database;host=$hostname';
my $dbh = DBI=>connect("$dsn", "$user", "$password") or die errstr

This works when run from an ordinary shell based perl program but when
we try to put it on the website into the cgi-bin it will not connect.
What are we doing wrong?

Robbert van Andel


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to