Even when the query is empty the If clause in the while loop will not print
"name NOT defined"
I suspect this has something to do with fetchrow_array and using !defined()
doesn't work.
==========================================================
my $query = "select deviceip, devicename from (select * from admDevice where
admDevice.devicename like \'%$_%\') as devi
ces, admSyslogSrc where devices.deviceId = admSyslogSrc.deviceId";
$sth = $dbh->prepare($query);
if( defined( $sth )) {
$sth->execute( );
}
while ( my ($hostint, $name) = $sth->fetchrow_array ) {
if ( !defined($name) ) {
print "name NOT defined";
}
_______________________________________________
kc mailing list
[email protected]
http://mail.pm.org/mailman/listinfo/kc