perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Derek Robson <robso...@ihug.co.nz>
Subject Re: modperl and DBI or DBD with mysql
Date Sat, 04 Feb 2006 22:40:45 GMT

that did not help, still no errors, still not good output.


At 06:10 a.m. 5/02/2006, Frank Wiles wrote:
>On Sat, 04 Feb 2006 20:45:05 +1300
>Derek Robson <robsonde@ihug.co.nz> wrote:
>
> > I am new to the world of modperl.
> >
> > Any help would be nice.
> >
> > I have some perl code that runs fine from the command line but not
> > with modperl.
> >
> > #!/usr/local/bin/perl
> > use strict;
> > use DBI;
> > print "Content-type: text/plain\n\n";
> > print "check1";
> > # Connect to the database.
> >    my $dbh =
> > DBI->connect
> > ("DBI:mysql:database=answerguy;host=elmo.elmo.theanswerguy.co.nz",
> > "robsonde", "ur4xgod", {'RaiseError' => 1});
>
>   You want to put a die statement here to test if you are connecting
>   to your database.  Something like:
>
>   my $dbh = DBI->connect( ........... ) or
>       die "Cannot connect to database: $!";
>
>   As I bet this is your problem. You won't get any errors in your Apache
>   log without using warn(), die(), croak(), or carp() because unless you
>   do, to parody the Matrix, "There is no error". :)
>
>   Hope this helps.
>
>  ---------------------------------
>    Frank Wiles <frank@wiles.org>
>    http://www.wiles.org
>  ---------------------------------
>
>
>
>--
>No virus found in this incoming message.
>Checked by AVG Free Edition.
>Version: 7.1.375 / Virus Database: 267.15.2/251 - Release Date: 4/02/2006


Mime
View raw message