They are all the same but they do this...
sub Do_SQL{
eval {
$sth = $dbh->prepare($SQL);
}; # end of eval
# check for errors
if($@){
$dbh->disconnect;
print "Content-type: text/html\n\n";
print "An ERROR occurred! $@\n";
exit;
} else {
$sth->execute;
} # end of if/else
return ($sth);
}
## End
| [reply] [d/l] |
Guess I'm confused then. Why have three identical subroutines with three different names?
Also, The subroutines return a statement handle, yet you are not capturing any return value. That means your first fetch is fetching what? And your second fetch literally doesn't exist, how are you retrieving anything from the db for the second select statement?
You say you didn't write the script, but are trying to adjust it. I can't see where the script ever worked at all, did you leave something out?
Scott
| [reply] |
Yeah, sorry. I'm lost on this. I'm definitely not the expert. I did leave out this line in the previous example
$pointer2 = $sth2->fetchrow_hashref;
I may be totally off on this and I'm just going in circles..lliterally.
I'm simply trying to check the bademails table and get all those emails in a list, then for each email check the alerts table (which has an email field with several emails separated by ~~~). If one is found, I want to take it out and replace it. Can't seem to accomplish that.
Thanks for any help you can give me. | [reply] [d/l] |