On 17 Dec 2002 08:09:25 -0500 chad kellerman <[EMAIL PROTECTED]> wrote:
> Everyone,
> thanks for the help with the script. I took everyone's input and
> rewrote it.
>
> #!/usr/bin/perl
Adding -w to this line will help spot a variety of runtime errors before
they accumulate.
> $dbh = DBI->connect( "DBI:mysql:database=".$dbname, $mysqluser,
> $mysqlpasswd, {RaiseError => 1 } ) or die "Cannot connect to database:
> $!";
Errors for DBI calls are available from $h->errstr or $DBI::errstr, not $!.
In this case, since you included {RaiseError => 1}, the 'or die' never gets
activated since any errors kill the program immediately.
> #first check for failed attempts
>
> $sth = $dbh->prepare( qq{ SELECT failedConAttempt FROM tblControl WHERE
> hostId="$hostId" } );
DBD::mysql simulates placeholders which are much safer than pasting values
into your SQL. I don't know if '"' is a valid string delimiter for mysql.
--
Mac :})
** I normally forward private questions to the appropriate mail list. **
Ask Smarter: http://www.tuxedo.org/~esr/faqs/smart-questions.html
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.