selectrow_array functions seems to die???
From: Ron Wingfield (rtwingfield_at_archaxis.net)
Date: 12/27/04
- Next message: Ron Wingfield: "Evaluated "require $database" not found."
- Previous message: Ron Wingfield: "OOP Perl and CGI Methods -- Any Known Problems?"
- Next in thread: Ron Wingfield: "Evaluated "require $database" not found."
- Reply: Ron Wingfield: "Evaluated "require $database" not found."
- Maybe reply: Ron Wingfield: "Re: selectrow_array functions seems to die???"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: <dbi-users@perl.org> Date: Sun, 26 Dec 2004 20:32:50 -0600
Here's another example of a cut of code that doesn't perform as expected. It's as if the selectrow_array() function is dying, as in (to) die.
if (! database_exists($database)) {
print qq(<b>Database $database </b>does not exist.<br>);
}
# Executing the "return" results in no display'able html code.
sub database_exists {
my ($dbh, $database) = @_;
$database =~ s/([%_])/\\$1/g; # escape any special characters
$dbh->{PrintError}=0;
$dbh->{RaiseError}=0;
return ($dbh->selectrow_array("SHOW DATABASES LIKE '$database'"));
}
I put in the "PrintError" and "RaiseError" instructions as an afterthought. I always prefer to trap all signals, interrupts, etc. and handle them myself; regardless, what is the selectrow_array() function doing that is killing the generation of html code?
OTTF,
Ron Wingfield
FreeBSD 4.8 -- Apache http 2.0.28 -- MySQL client/server 4.1.7
Perl 5.8.5 -- p5-DBD-mysql-2.9004 driver -- p5-DBI-1.46
--------------------------------------------------------------------------------
- Next message: Ron Wingfield: "Evaluated "require $database" not found."
- Previous message: Ron Wingfield: "OOP Perl and CGI Methods -- Any Known Problems?"
- Next in thread: Ron Wingfield: "Evaluated "require $database" not found."
- Reply: Ron Wingfield: "Evaluated "require $database" not found."
- Maybe reply: Ron Wingfield: "Re: selectrow_array functions seems to die???"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|