Home : Products : Gossamer Links : Discussions :

Products: Gossamer Links: Discussions: help wanted: add links with a bulk routine: Edit Log

Here is the list of edits for this post
help wanted: add links with a bulk routine
Hi,

I am updating the Links table from another table and I am having some troubles there.

I changed my ID and LinksID to varchar but the problem already occured before.
I use:

Code:
foreach .. {

my @CategoryID = ('71007');
$add->{"CatLinks.LinkID"} = $add->{ID}; # $add->{ID} is predifined and unique
$add->{"CatLinks.CategoryID"} = \@CategoryID;
$added = $db->{Links}->add($add);
!$added ? ($error .= join('', map "$_ $add->{MPID}\n", $db->{Links}->error)) : print "$add->{ID} added\n";
}

This way only Links are added, no CatLinks.
When I add

Code:
$sth->{CatLinks} = $db->{CatLinks}->prepare("INSERT INTO glinks_CatLinks (LinkID, CategoryID) VALUES (?, ?)");
$sth->{CatLinks}->execute($add->{ID},71007)

It works

removing

Code:
my @CategoryID = ('71007');
$add->{"CatLinks.LinkID"} = $add->{ID}; # $add->{ID} is predifined and unique
$add->{"CatLinks.CategoryID"} = \@CategoryID;

leads to an error:
Quote:
You did not specify a category for this link.

If I turn on debug there is a SQL-Command for adding the Link record but not the CatLink record.

I am a little confused.

Thanks for help

n || i || k || o

Last edited by:

el noe: Jun 19, 2007, 9:14 AM

Edit Log: