[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: mysql - perl - cgi problem
- From: "Alan Mead" <amead8695 home com>
- To: <redhat-list redhat com>
- Subject: Re: mysql - perl - cgi problem
- Date: Fri, 5 Oct 2001 12:14:59 -0500
So it sounds like you've solved the problem. FYI, if you don't already do
this, here are some ways to get more information about CGI problems.
Put these in the list of use statements (usually at the top of the file):
use CGI::Carp qw(fatalsToBrowser);
use strict;
use diagnostics;
My CGI file start like this:
use CGI qw/:standard :html3/;
use CGI::Carp qw(fatalsToBrowser);
use DBI;
use strict;
use diagnostics;
Then make sure you are connecting like this:
# make a connection to the database server
my $dbh = DBI->connect($sql_database,$sql_login,$sql_password,'mysql');
unless ($dbh) {
die "Unable to connect to MySQL database server: $DBI::errstr.\n";
}
You should generally get errors on the screen when something goes wrong.
You'll want to be careful about carping errors to the screen in production
CGI scripts ... there is some chance that something private can be printed
for everyone to see.
-Alan Mead
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]