Hi. Im working on a global that will show a list of the categories... it is as follows;
my $category;
my $db = $DB->table('Category') || return $GT::SQL::error;
$db->select_options('ORDER BY Full_Name') || return $GT::SQL::error;
my $sth = $db->select() || return $GT::SQL::error;
while (my ($id,$full_name) = $sth->fetchrow_array) {
my @cut = split /\//, $full_name;
my $back = '';
for (my $i=0; $i < $#cut; $i++) {
$back .= " ";
}
$back .= " " . $cut[$#cut];
}
my $send_back = qq|<select size="1" name="catid"><option value="">------</option>$back</select>|;
return $send_back;
}
The idea of the output would be;
Sub1
Sub2
Another
Sub
Sub
Test
Test2
The problem is, the above global is giving me a 'compilation' error. Can anyone see my stupid mistake? I've been looking over this global for the last couple of hours... and its completly evaded me :(
TIA
Andy (mod)
andy@ultranerds.co.uk
IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Code:
sub { my $category;
my $db = $DB->table('Category') || return $GT::SQL::error;
$db->select_options('ORDER BY Full_Name') || return $GT::SQL::error;
my $sth = $db->select() || return $GT::SQL::error;
while (my ($id,$full_name) = $sth->fetchrow_array) {
my @cut = split /\//, $full_name;
my $back = '';
for (my $i=0; $i < $#cut; $i++) {
$back .= " ";
}
$back .= " " . $cut[$#cut];
}
my $send_back = qq|<select size="1" name="catid"><option value="">------</option>$back</select>|;
return $send_back;
}
The idea of the output would be;
Code:
Name Sub1
Sub2
Another
Sub
Sub
Test
Test2
The problem is, the above global is giving me a 'compilation' error. Can anyone see my stupid mistake? I've been looking over this global for the last couple of hours... and its completly evaded me :(
TIA
Andy (mod)
andy@ultranerds.co.uk
IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates



