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
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
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
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!