Hi. Try this. It should list cateogires where the father ID is greater than 0 (i.e not root categories)....
my $table = $DB->table('Category');
my $return_cats;
$table->select_options ('ORDER BY Name ASC');
my $cond = GT::SQL::Condition->new('FatherID','>','0');
my $sth = $table->select( $cond );
while (my $hit = $sth->fetchrow_hashref) {
$return_cats .= "<option value=\"" . $hit->{ID} . "\">" . $hit->{Full_Name} . "</option>";
}
return $return_cats;
}
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 $table = $DB->table('Category');
my $return_cats;
$table->select_options ('ORDER BY Name ASC');
my $cond = GT::SQL::Condition->new('FatherID','>','0');
my $sth = $table->select( $cond );
while (my $hit = $sth->fetchrow_hashref) {
$return_cats .= "<option value=\"" . $hit->{ID} . "\">" . $hit->{Full_Name} . "</option>";
}
return $return_cats;
}
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!