Hello;

I'm searching through a Postgres database for an IP address, when the IP
is found everything works fine.  If the IP address is not in the database
however, I get the following error when searching for 131.127.117.240
which is not in the database:

[Mon Jun 07 13:02:46 2004] [error] [client 192.168.255.6] malformed header
from script. Bad header=131.127.117.240 was not found : canopy.cgi,
referer: http://my.domain.org/index.html
[Mon Jun 07 13:02:46 2004] [error] [client 192.168.255.6] Couldn't fetch
row array, referer: http://my.domain.org/index.html

The section of code that is causing the error looks like this:

if($searchFor eq "radioip") {
    $sql = $dbh->prepare("SELECT CustNo FROM radio WHERE RadioIP = ?");
    $sql->execute($searchString) or warn "Couldn't execute statement\n";
    @row = $sql->fetchrow_array() or warn "Couldn't fetch row array\n";
    ($custNo) = @row;
    if($custNo) {
        DisplayEntry($custNo);
    }else{
        print "$searchString was not found in the $searchFor field\n";
    }
}

Is there an easy way to tell if the execute statement was succesful
without actually using fetchrow_array()?

--
Rob
   _o
 _< \_   Do not meddle in the affairs of wizards,
(_)>(_)  for they are subtle and quick to anger.

Reply via email to