what error(s) are you getting?  Make sure you die with $DBI->errstr to see
what is happening.  It could be any number of things at this point.  Have
you tried hard-coding the information in just to make sure it works that
way?  Then try with variables.

Brent





                                                                                       
                                                
                      "Van Andel,                                                      
                                                
                      Robbert"                 To:       "Brent Michalski" 
<[EMAIL PROTECTED]>                            
                      <RVanAndel@charte        cc:       <[EMAIL PROTECTED]>      
                                                
                      rcom.com>                Subject:  RE: Database connection 
trouble                                               
                                                                                       
                                                
                      02/21/2003 11:12                                                 
                                                
                      AM                                                               
                                                
                                                                                       
                                                
                                                                                       
                                                




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]







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

Reply via email to