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:
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
$sth->{CatLinks}->execute($add->{ID},71007)
It works
removing
$add->{"CatLinks.LinkID"} = $add->{ID}; # $add->{ID} is predifined and unique
$add->{"CatLinks.CategoryID"} = \@CategoryID;
leads to an error:
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
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