Hi,
I'm just wondering, does anyone know why this would return "1" even if URL = xxx doesn't exist in the InternalPages table?
BTW - $dbh is being opened fine (thats not the issue, it just returns 1 when I would expect it to return 0)
my $url = $_[0];
my $sth = $dbh->prepare(qq|SELECT COUNT(*) FROM InternalPages WHERE URL = ?|) || die $DBI::errstr;
$sth->bind_param(1,$url);
my $count = $sth->execute() || die $DBI::errstr;
print qq|SELECT COUNT(*) FROM InternalPages WHERE URL = $url \n|;
print "COUNT: $count \n";
return $count;
}
Probably missing something really silly - I just get too used to using GT::SQL's count() function
TIA
Andy (mod)
andy@ultranerds.co.uk
IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
I'm just wondering, does anyone know why this would return "1" even if URL = xxx doesn't exist in the InternalPages table?
BTW - $dbh is being opened fine (thats not the issue, it just returns 1 when I would expect it to return 0)
Code:
sub check_been_spidered_already { my $url = $_[0];
my $sth = $dbh->prepare(qq|SELECT COUNT(*) FROM InternalPages WHERE URL = ?|) || die $DBI::errstr;
$sth->bind_param(1,$url);
my $count = $sth->execute() || die $DBI::errstr;
print qq|SELECT COUNT(*) FROM InternalPages WHERE URL = $url \n|;
print "COUNT: $count \n";
return $count;
}
Probably missing something really silly - I just get too used to using GT::SQL's count() function
TIA
Andy (mod)
andy@ultranerds.co.uk
IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates

