Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

check duplicates terms

Quote Reply
check duplicates terms
So far the duplicate check term is to find any duplicate URL's in LinksSQL database.

What do I have to change if I want to make it to find any duplicate Title's in the database ?

I've already try this:

Quote:
sub check_duplicates {
# --------------------------------------------------------
# This routine searches through the database and pulls up sets
# of links that have identical URL's.
#
my ($in, $db) = @_;
my ($query, $sth, $doubles, %doubles, $url, $hits);
my $offset = $in->param('offset') | | 0;

$query = qq!
SELECT URL, COUNT(*) as hits
FROM Links
GROUP BY URL
HAVING hits > 1
ORDER BY hits DESC
LIMIT $offset, 10
!;
$sth = $db->prepare ($query);
$sth->execute or die "Execute failed: $DBI::errstr";

while (($url, $hits) = $sth->fetchrow_array) {
$doubles = $db->query ( { URL => $url, ww => 1, tb => 0 } );
$doubles{$url} = $doubles;
}
$sth->finish;
&html_check_duplicates ($in, $db, \%doubles);
}

I've changed it into this :

Quote:
sub check_duplicates {
# --------------------------------------------------------
# This routine searches through the database and pulls up sets
# of links that have identical URL's.
#
my ($in, $db) = @_;
my ($query, $sth, $doubles, %doubles, $title, $hits);
my $offset = $in->param('offset') | | 0;

$query = qq!
SELECT Title, COUNT(*) as hits
FROM Links
GROUP BY Title
HAVING hits > 1
ORDER BY hits DESC
LIMIT $offset, 10
!;
$sth = $db->prepare ($query);
$sth->execute or die "Execute failed: $DBI::errstr";

while (($title, $hits) = $sth->fetchrow_array) {
$doubles = $db->query ( { Title => $title, ww => 1, tb => 0 } );
$doubles{$title} = $doubles;
}
$sth->finish;
&html_check_duplicates ($in, $db, \%doubles);
}

but I got this error:

Quote:
Software error:
Execute failed: The table 'SQL12a684_0' is full

Anyone can help?

rgds,







[This message has been edited by Oeoet (edited December 23, 1999).]

[This message has been edited by Oeoet (edited December 23, 1999).]