Gossamer Forum
Home : General : Perl Programming :

Letting duplication happen

Quote Reply
Letting duplication happen
Hi,

Can you tell me what part of this code looks for duplicates? What I would like to do is allow duplicates to be submitted.

Code:

my $links_sth = $db->select ( { URL => $input->{URL} }, ['ID'] );
if ($links_sth->rows) {
import_print("Unable to import `$_' (line $. of $$vars{full_path}): URL already existed in the database\n");
next;
}


Thanks in advance
Quote Reply
Re: [Teambldr] Letting duplication happen In reply to
Hi,

It would be the;

Code:
if ($links_sth->rows) {
...
}

part. Basically, the my $links_sth = $db->select ... bit gets the records, and if $links_sth->rows (the number of grabbed results) is greater than 0, it will come up as true (and thus it exists already).

Hope that helps.

Cheers

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