Hi,
To have that work, you would need a global. Something like this:
get_category_details
my $tbl = $DB->table('CatLinks');
$tbl->select_options("ORDER BY CategoryID");
my $cat_id = $tbl->select ( ['CategoryID'], { LinkID => $_[0] } )->fetchrow;
my $cat = $DB->table('Category')->get( { ID => $cat_id } );
my $hit;
map { $hit->{"category_" . %_} = $cat->{$_} } keys %$cat;
return $hit;
}
(just wrote it, so unteested ;))
Call with:
<%get_category_details($ID)%>
..then call the category fields with category_ prefixing the fields, for example:
<%category_Full_Name%>, <%category_Number_of_Hits%>, etc
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!
To have that work, you would need a global. Something like this:
get_category_details
Code:
sub { my $tbl = $DB->table('CatLinks');
$tbl->select_options("ORDER BY CategoryID");
my $cat_id = $tbl->select ( ['CategoryID'], { LinkID => $_[0] } )->fetchrow;
my $cat = $DB->table('Category')->get( { ID => $cat_id } );
my $hit;
map { $hit->{"category_" . %_} = $cat->{$_} } keys %$cat;
return $hit;
}
(just wrote it, so unteested ;))
Call with:
<%get_category_details($ID)%>
..then call the category fields with category_ prefixing the fields, for example:
<%category_Full_Name%>, <%category_Number_of_Hits%>, etc
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!