Hi:
I wanted to write a global to return the Full Name of a Random Category... kind of a weird idea I had. Anyway, I played around with some code, and got as far as this, but was not completely working. Anyone want to see if they can spot my mistake?
sub {
no strict;
my $db = $DB->table('Category');
my $total = $db -> count;
my $rand = int( rand($total) );
my $sth = $obj->select ( { ID => $rand } );
my $html = $sth->{'Full_Name'};
return $html;
}
Thanks!
dave
dave
Big Cartoon DataBase
Big Comic Book DataBase
I wanted to write a global to return the Full Name of a Random Category... kind of a weird idea I had. Anyway, I played around with some code, and got as far as this, but was not completely working. Anyone want to see if they can spot my mistake?
Quote:
sub {
no strict;
my $db = $DB->table('Category');
my $total = $db -> count;
my $rand = int( rand($total) );
my $sth = $obj->select ( { ID => $rand } );
my $html = $sth->{'Full_Name'};
return $html;
}
Thanks!
dave
dave
Big Cartoon DataBase
Big Comic Book DataBase