Create a new global... called link_cat, with the following codes;
my $ID = $_[0];
my ($CatID,$CatName);
my $sth = $DB->table('CatLinks')->select( { LinkID => $ID } );
while (my $hit = $sth->fetchrow_hashref) {
$CatID = $hit->{CategoryID};
}
my $sth = $DB->table('Category')->select( { ID => $CatID } );
while (my $hit = $sth->fetchrow_hashref) {
$CatName = $hit->{Full_Name};
}
$CatName ? return $CatName : return;
}
Call this with: <%link_cat($ID)%>
Untested, but it should work.
Cheers
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!
Code:
sub { my $ID = $_[0];
my ($CatID,$CatName);
my $sth = $DB->table('CatLinks')->select( { LinkID => $ID } );
while (my $hit = $sth->fetchrow_hashref) {
$CatID = $hit->{CategoryID};
}
my $sth = $DB->table('Category')->select( { ID => $CatID } );
while (my $hit = $sth->fetchrow_hashref) {
$CatName = $hit->{Full_Name};
}
$CatName ? return $CatName : return;
}
Call this with: <%link_cat($ID)%>
Untested, but it should work.
Cheers
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!