Can anyone please explain to me what is wrong with the following? I'm really running out of hair to pull out here!
# $sth0 = $dbh->prepare($sqlstat_isrecordthere);
# $sth0->execute;
# $listofids = $sth0->fetchall_arrayref({});
# $sth0->finish;
# foreach $isidthere (@$listofids) {
# if ($isidthere->{'id'} != "$A::id") {
# &error_html("No such record.");
# &exit(0);
# }
# }
What this snippet of code should do:
Dip into the database.
Select colum id from all records.
See if my $A::id that's passed to the script matches any id found in the database.
If it doesn't, transfer to error subroutine and exit.
If it does find a match, continue onto next sub.
For some reason, the sub keeps telling me that it can not find a match every time. I just can't think of what I'm doing wrong. Anyone with any ideas?
Thanks!!
Wil
Code:
# $sqlstat_isrecordthere = "SELECT id FROM geog"; # $sth0 = $dbh->prepare($sqlstat_isrecordthere);
# $sth0->execute;
# $listofids = $sth0->fetchall_arrayref({});
# $sth0->finish;
# foreach $isidthere (@$listofids) {
# if ($isidthere->{'id'} != "$A::id") {
# &error_html("No such record.");
# &exit(0);
# }
# }
What this snippet of code should do:
Dip into the database.
Select colum id from all records.
See if my $A::id that's passed to the script matches any id found in the database.
If it doesn't, transfer to error subroutine and exit.
If it does find a match, continue onto next sub.
For some reason, the sub keeps telling me that it can not find a match every time. I just can't think of what I'm doing wrong. Anyone with any ideas?
Thanks!!
Wil